vitmalina / w2ui

UI widgets for modern apps. Data table, forms, toolbars, sidebar, tabs, tooltips, popups. All under 120kb (gzipped).

Home Page:http://w2ui.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

decimalSymbol not working

quagliarellamichel opened this issue · comments

commented

Hi I have encountered a problem with decimal separators.

in us format the decimal separator is "." but in italy the separator is "," I tried this configuration

import { w2utils } from "/w2ui-2.0/w2ui-2.0.es6.min.js"

w2utils.locale({
dateFormat : "dd/mm/yyyy",
timeFormat : "hh:mm",
currencyPrefix : "€ ",
currencySuffix : "",
currencyPrecision : 2,
groupSymbol : "",
decimalSymbol : ","
});

let win = new w2form({
"name": "win",
"style": "border: 0; background-color: transparent;"
"autosize": true,
"fields": [
{
"field": "price",
"type": "money",
"required": true,
"html": {
"label": "price"
}
},
]
})

but on typing the comma is accepted but the output on the filed is always with the dot

w2utils.locale({
dateFormat : "dd/mm/yyyy",
timeFormat : "hh:mm",
currencyPrefix : "€ ",
currencySuffix : "",
currencyPrecision : 2,
groupSymbol : ".",
decimalSymbol : ","
});

does not completely accept the value of the filed

can you create jsFiddle?

commented

https://jsfiddle.net/mquagliarella/hwtrq1bs/94/

image

ignore decimalSymbol = ","
and if i use groupSymbol dasn't work

One Addition. The given settings, especially these two lines

w2utils.settings.groupSymbol = ".";
w2utils.settings.decimalSymbol = ",";

will also break the search of all "int" and "float" fields.