10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-11-04 13:13:55 +01:00

Add stringFLoat class in js that help to keep significant figure

This commit is contained in:
Mickaël Véril 2020-02-01 16:58:43 +01:00
parent ea6c37d4f9
commit 74509f97ee

18
static/js/stringFloat.js Normal file
View File

@ -0,0 +1,18 @@
class stringFloat{
constructor(value) {
this.string=value
}
get Value(){
return parseFloat(this.string)
}
valueOf() {
return this.Value;
}
toString(){
if (isNaN(checkFloat(this.Value))) {
return this.Value
} else {
return this.string
}
}
}