parseInt() value help
-
-
@Christoph-Hart thanks for this! Math.round gets the job done, so I'm happy :)
-
Welp, it's August, so "08" by JUCE time, and this just broke all of my licensing systems lol. Time for an update to
Math.round()
-
Wow that sounds super annoying.
If you want to globally deactivate octal number parsing, just make that function return always
false
: -
@Christoph-Hart Thanks Christoph
Is This Helps To Fix The Frontendmacros Aswell?
Values Looks Strange There Too -
Update:
Return False is NOT The Answer :/
And Console, Shows This Error, Even In A Project WIth Nothing Than GUI SizeLine 1, column 28: Syntax error in numeric constant {SW50ZXJmYWNlfHwyN3wxfDI4}
-
@Christoph-Hart It's all good. It was a 5 minute fix, but a several hour debug haha. Fortunately, I don't think it broke the compiled plugin.
-
confused
I just used this function to parse date and time. It's OK when using javascript in browser.
for(var i = 0; i < 10; i++) console.log(parseInt("0" + i)); // 0 1 2 3 4 5 6 7 8 9
but weird in HISE:
for(i = 0; i < 10; i++) Console.print(parseInt("0" + i)); // 0 1 2 3 4 5 6 7 0 0
finally, I do a trick:
for(i = 0; i < 10; i++) Console.print(parseInt("+0" + i)); // 0 1 2 3 4 5 6 7 8 9
-
@civet HISEScript != javascript
-
@Lindon Yes, I know. I have read the docs carefully.
but
parseInt()
is very commonly used in scripts. and it's likelyparseInt()
in HISE does not support the second parameter.parseInt("010", 10); // always return 8 in HISE