10
0
mirror of https://github.com/LCPQ/QUESTDB_website.git synced 2024-12-25 13:53:48 +01:00

rename Float to Number in JavaScript

This commit is contained in:
Mickaël Véril 2020-02-04 09:14:57 +01:00
parent 5392b9ee53
commit 3c2da95c84
3 changed files with 7 additions and 7 deletions

View File

@ -24,7 +24,7 @@ draft: false
<script src="/js/selectSelectAll.js"></script> <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://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="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> <script>
function adjustSticky(){ function adjustSticky(){
const height=$("nav").height() const height=$("nav").height()

View File

@ -279,9 +279,9 @@ class dataFileBase {
type = m[1] type = m[1]
} }
} }
var val = ((vals.length >= 7 + hasType) ? new stringFloat(vals[6 + hasType]) : NaN) var val = ((vals.length >= 7 + hasType) ? new stringNumber(vals[6 + hasType]) : NaN)
var oscilatorForces = ((vals.length >= 8 + hasType) ? new stringFloat(vals[7 + hasType]) : NaN) var oscilatorForces = ((vals.length >= 8 + hasType) ? new stringNumber(vals[7 + hasType]) : NaN)
var T1 = ((vals.length >= 9 + hasType) ? new stringFloat(vals[8 + 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 isUnsafe = ((vals.length >= 10 + hasType) ? vals[9 + hasType] === true.toString() : false)
var ex = new excitationValue(start, end, type, val, oscilatorForces, T1, isUnsafe); var ex = new excitationValue(start, end, type, val, oscilatorForces, T1, isUnsafe);
if (this.VertExcitationKind) { if (this.VertExcitationKind) {

View File

@ -1,4 +1,4 @@
class stringFloat{ class stringNumber{
constructor(value,printNaN=true) { constructor(value,printNaN=true) {
this.string=value this.string=value
this.printNaN=printNaN this.printNaN=printNaN
@ -10,14 +10,14 @@ class stringFloat{
return this.Value; return this.Value;
} }
toString(){ toString(){
if (checkFloat(this.string) && this.printNaN) { if (checkNumber(this.string) && this.printNaN) {
return this.string return this.string
} else { } else {
return NaN.toString() return NaN.toString()
} }
} }
} }
function checkFloat(string) { function checkNumber(string) {
try { try {
return !Number.isNaN(parseFloat(string)) return !Number.isNaN(parseFloat(string))
} catch (error) { } catch (error) {