Page 1 of 1

Exponents in ASCIIOUTPUT

Posted: Wed Sep 26, 2012 1:14 pm
by Steve Rowe
Just had an issue here where a remote TM1 site was generating data formatted as exponents in their ASCIIOutput routines but just for very small numbers.

i.e. 0.000000003 was being exported as 3e-09

This was causing us data type issues in the relational world we were passing data to. (Yes I know, don't ask)

This issue was caused by TIs different data type conversion.

If you set the your value field to the data type string in the variable tab then you get exponents for small values (the smallest I saw was 1e-05). It did not appear to do this for large numbers.

If you set the data type to numeric and then use numbertostring or str in your asciioutput statement then you get a proper number string i.e. “0.000000003”

Hopefully this will help some else out if they come across this rather annoying wrinkle….

Seen in 9.5.1

Re: Exponents in ASCIIOUTPUT

Posted: Wed Sep 26, 2012 2:49 pm
by tomok
This is how it has been for as long as I can remember. TM1 puts small numbers in exponential format in the logs too. The only way to change it for an export is to specifically ask for the format you want, like you did with the NumbertoString function. You can't do anything about the logs that I know of, they're still going to be exponential.

Re: Exponents in ASCIIOUTPUT

Posted: Wed Sep 26, 2012 4:23 pm
by Steve Rowe
Sure, I don't really ever set a number to string in the variables tab so I'd never noticed this difference in behaviour.

NumberToString doesn't have any format type information (unlike Str) so I was trying to point out the different behaviour when you do the type conversion using NumberToString vs doing it in the variables tab.

Cheers,

Re: Exponents in ASCIIOUTPUT

Posted: Thu Sep 27, 2012 8:58 am
by Wim Gielis
Hi

NumberToStringEx( ) is an alternative too.