Try this:
Code: Select all
nNumber = 4283.775
nRounded = ROUNDP(nNumber, 2);
sRounded = NumberToStringEx(nRounded, '#.00', '.', '');
ASCIIOUTPUT('D:\TM1\Log\test.txt', NumberToString(nNumber), NumberToString(nRounded), sRounded);
A colleague of mine enlightened me that this figure with decimal when stored in TM1 as floating, it doesn't really get stored as 4283.775 but 4283.77490234375, which is why the roundp seems like it's not doing it's job.
Sounds to me that we shouldn't be using roundp if there is a chance of hitting such jackpot figure. Instead, we should do StringToNumber(NumberToStringEx(nRounded, '#.00', '.', '');
Any thoughts?