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:
parent
ea6c37d4f9
commit
74509f97ee
18
static/js/stringFloat.js
Normal file
18
static/js/stringFloat.js
Normal 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
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user