Categories > OpenTBS with XLSX >

using ope=tbs:num with large numbers (> MAX_INT)

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Carsten
Date: 2014-02-06
Time: 16:29

using ope=tbs:num with large numbers (> MAX_INT)

Hi,

In my Excel Template I use "[block.value; ope=tbs:num]" for merging numbers. However, this works fine as long as the values are smaller than 2.2 billion (usually MAX_INT).
The PHP variables are of type double, so this does not seem to be a PHP problem. Echoing those variables gives the correct result, e.g. "7,580,563,123".
After merging the values into the Excel file, the numbers have different values (also negative, it looks like an overflow).

As a workaround I currently merge them as strings into the file (using  "[block.value]", without the "ope=tbs:num"). However, it would be great to be able to merge big numbers as numbers, not as strings.
Any suggestions?

Thanks in advance,
Carsten

(I am using OpenTBS - 1.8.1 beta)
By: Skrol29
Date: 2014-02-07
Time: 03:33

Re: using ope=tbs:num with large numbers (> MAX_INT)

Hi Carsten,

How do you store your big numbers in PHP ?
By: Skrol29
Date: 2014-02-08
Time: 12:11

Re: using ope=tbs:num with large numbers (> MAX_INT)

There will be a fix for that in the next release.

Meanwhile, you can avoid the problem by adding ".0" to your number then it will be processed by OpenTBS as a double.
By: Carsten
Date: 2014-02-10
Time: 09:57

Re: using ope=tbs:num with large numbers (> MAX_INT)

Thank you,

the string workaround with
$num.'.0'
works perfectly! :-)