mirror of
https://github.com/LCPQ/QUESTDB_website.git
synced 2024-12-24 13:23:40 +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