Page 1 of 1

Number Formula

Posted: Wed May 31, 2017 9:05 pm
by Jorge Rachid
Hi Everyone!

I have to do a formula with number, but I am facing some diffult.

I have these numbers:

1,81
2,00
1,71
1,69
2,00
1,44
2,00

And I would like these numbers after a formula as below:

1,80
2,00
1,70
1,65
2,00
1,40
2,00

It is the FLOOR formula from excel.

Does anyone have any idea how to do this on TM1?

I have thought about round and roundp but in this case it is not enough.

Thanks,

JR

Re: Number Formula

Posted: Wed May 31, 2017 9:24 pm
by Wim Gielis

Code: Select all

AsciiOutput( 'test.txt', NumberToString( int(1.81/0.05) * 0.05 ));
AsciiOutput( 'test.txt', NumberToString( int(2.00/0.05) * 0.05 ));
AsciiOutput( 'test.txt', NumberToString( int(1.71/0.05) * 0.05 ));
AsciiOutput( 'test.txt', NumberToString( int(1.69/0.05) * 0.05 ));
AsciiOutput( 'test.txt', NumberToString( int(2.00/0.05) * 0.05 ));
AsciiOutput( 'test.txt', NumberToString( int(1.44/0.05) * 0.05 ));
AsciiOutput( 'test.txt', NumberToString( int(2.00/0.05) * 0.05 ));

Re: Number Formula

Posted: Thu Jun 01, 2017 12:11 am
by Jorge Rachid
Hi Wim.

I will try this tomorrow, but I simulated on excel and it works.

Thank you so much for helping me.

Best regards,

JR