mirror of
https://github.com/LCPQ/QUESTDB_website.git
synced 2024-11-04 13:13:55 +01:00
rename Float to Number in JavaScript
This commit is contained in:
parent
5392b9ee53
commit
3c2da95c84
@ -24,7 +24,7 @@ draft: false
|
||||
<script src="/js/selectSelectAll.js"></script>
|
||||
<script src="https://unpkg.com/simple-statistics@7.0.2/dist/simple-statistics.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bowser@2.5.3/es5.min.js"></script>
|
||||
<script src="/js/floatUtils.js"></script>
|
||||
<script src="/js/NumberUtils.js"></script>
|
||||
<script>
|
||||
function adjustSticky(){
|
||||
const height=$("nav").height()
|
||||
|
@ -279,9 +279,9 @@ class dataFileBase {
|
||||
type = m[1]
|
||||
}
|
||||
}
|
||||
var val = ((vals.length >= 7 + hasType) ? new stringFloat(vals[6 + hasType]) : NaN)
|
||||
var oscilatorForces = ((vals.length >= 8 + hasType) ? new stringFloat(vals[7 + hasType]) : NaN)
|
||||
var T1 = ((vals.length >= 9 + hasType) ? new stringFloat(vals[8 + hasType]) : NaN)
|
||||
var val = ((vals.length >= 7 + hasType) ? new stringNumber(vals[6 + hasType]) : NaN)
|
||||
var oscilatorForces = ((vals.length >= 8 + hasType) ? new stringNumber(vals[7 + hasType]) : NaN)
|
||||
var T1 = ((vals.length >= 9 + hasType) ? new stringNumber(vals[8 + hasType]) : NaN)
|
||||
var isUnsafe = ((vals.length >= 10 + hasType) ? vals[9 + hasType] === true.toString() : false)
|
||||
var ex = new excitationValue(start, end, type, val, oscilatorForces, T1, isUnsafe);
|
||||
if (this.VertExcitationKind) {
|
||||
|
@ -1,4 +1,4 @@
|
||||
class stringFloat{
|
||||
class stringNumber{
|
||||
constructor(value,printNaN=true) {
|
||||
this.string=value
|
||||
this.printNaN=printNaN
|
||||
@ -10,14 +10,14 @@ class stringFloat{
|
||||
return this.Value;
|
||||
}
|
||||
toString(){
|
||||
if (checkFloat(this.string) && this.printNaN) {
|
||||
if (checkNumber(this.string) && this.printNaN) {
|
||||
return this.string
|
||||
} else {
|
||||
return NaN.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
function checkFloat(string) {
|
||||
function checkNumber(string) {
|
||||
try {
|
||||
return !Number.isNaN(parseFloat(string))
|
||||
} catch (error) {
|
Loading…
Reference in New Issue
Block a user