chrisjj
1
-
$num fails with numbers that though large are within script arithmetic range e.g.
Pad UPC 043011001826 to EAN: $num(043011001826,14) (expected 0043011001826)
Compute 043011001826+1: $add(043011001826,1) (expected 43011001827 and got same)
gives
Pad UPC 043011001826 to EAN: 2147483647 (expected 0043011001826)
Compute 043011001826+1: 43011001827 (expected 43011001827 and got same)
-
$num fails when asked for more than five digits e.g.
Pad catalogue number to six places: $num(1826,6) (expected 001826)
gives
Pad catalogue number to six places: 01826 (expected 001826).
Florian
2
The $num function is limited to 5 digits. I'll update the documentation.
chrisjj
3
Thanks. But note that even with five digits it can fail e.g. $num(3011001826,5) -> 2147483647 .
Florian
4
This is the upper limit of the int data type. Maybe I can use 64 bit ints.
Florian
5
I've found a solution which removes broadens the limits. It will be included in the next release.
chrisjj
6
This is the upper limit of the int data type.
Doesn't the $add example show otherwise?
Florian
7
$add already uses 64 bit instead of 32 bit integers.
chrisjj
8
$add already uses 64 bit instead of 32 bit integers.
Ah, so $add and $num use different types...
I've found a solution
Thanks!
Florian
9
It has been changed in the current Development Build.
chrisjj
10
Confirmed - both examples work in V2.39f.
Thanks! And thanks for the handy expression evaluator on ALT-1! 
Florian
Closed
11
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.