forked from MapComplete/MapComplete
Add number formatting
This commit is contained in:
parent
96c11badaf
commit
00eb6aa008
1 changed files with 5 additions and 5 deletions
|
@ -171,7 +171,7 @@ export default class ValidatedTextField {
|
|||
str = "" + str;
|
||||
return str !== undefined && str.indexOf(".") < 0 && !isNaN(Number(str))
|
||||
},
|
||||
undefined,
|
||||
str => "" + Number(str),
|
||||
undefined,
|
||||
"numeric"),
|
||||
ValidatedTextField.tp(
|
||||
|
@ -181,7 +181,7 @@ export default class ValidatedTextField {
|
|||
str = "" + str;
|
||||
return str !== undefined && str.indexOf(".") < 0 && !isNaN(Number(str)) && Number(str) >= 0
|
||||
},
|
||||
undefined,
|
||||
str => "" + Number(str),
|
||||
undefined,
|
||||
"numeric"),
|
||||
ValidatedTextField.tp(
|
||||
|
@ -191,21 +191,21 @@ export default class ValidatedTextField {
|
|||
str = "" + str;
|
||||
return str !== undefined && str.indexOf(".") < 0 && !isNaN(Number(str)) && Number(str) > 0
|
||||
},
|
||||
undefined,
|
||||
str => "" + Number(str),
|
||||
undefined,
|
||||
"numeric"),
|
||||
ValidatedTextField.tp(
|
||||
"float",
|
||||
"A decimal",
|
||||
(str) => !isNaN(Number(str)),
|
||||
undefined,
|
||||
str => "" + Number(str),
|
||||
undefined,
|
||||
"decimal"),
|
||||
ValidatedTextField.tp(
|
||||
"pfloat",
|
||||
"A positive decimal (incl zero)",
|
||||
(str) => !isNaN(Number(str)) && Number(str) >= 0,
|
||||
undefined,
|
||||
str => "" + Number(str),
|
||||
undefined,
|
||||
"decimal"),
|
||||
ValidatedTextField.tp(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue