Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

decimalSymbol not working #2470

Open
quagliarellamichel opened this issue Dec 14, 2023 · 3 comments
Open

decimalSymbol not working #2470

quagliarellamichel opened this issue Dec 14, 2023 · 3 comments

Comments

@quagliarellamichel
Copy link

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

@vitmalina
Copy link
Owner

can you create jsFiddle?

@quagliarellamichel
Copy link
Author

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

image

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

@peterGdot
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants