vitmalina / w2ui

UI widgets for modern apps. Data table, forms, toolbars, sidebar, tabs, tooltips, popups. All under 120kb (gzipped).
http://w2ui.com
MIT License
2.67k stars 727 forks source link

decimalSymbol not working #2470

Open quagliarellamichel opened 11 months ago

quagliarellamichel commented 11 months ago

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 commented 11 months ago

can you create jsFiddle?

quagliarellamichel commented 9 months ago

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

image

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

peterGdot commented 7 months ago

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.