mirror of
https://github.com/LCPQ/QUESTDB_website.git
synced 2024-11-04 13:13:55 +01:00
Add optional printNaN to stringFloat
This commit is contained in:
parent
02dfbe9a9e
commit
8d47040564
@ -1,6 +1,7 @@
|
||||
class stringFloat{
|
||||
constructor(value) {
|
||||
constructor(value,printNaN=true) {
|
||||
this.string=value
|
||||
this.printNaN=printNaN
|
||||
}
|
||||
get Value(){
|
||||
return parseFloat(this.string)
|
||||
@ -9,10 +10,10 @@ class stringFloat{
|
||||
return this.Value;
|
||||
}
|
||||
toString(){
|
||||
if (checkFloat(this.string)) {
|
||||
return this.Value
|
||||
} else {
|
||||
if (checkFloat(this.string) && this.printNaN) {
|
||||
return this.string
|
||||
} else {
|
||||
return NaN.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user