Page 1 of 1

MOD54415 iprintf() for float type problem

Posted: Tue Feb 26, 2013 11:40 am
by Arturino
I'm having problems with float numbers output on NB54415.

Command:

Code: Select all

iprintf("Val %4.2f \r\n", 3.132543);
returns

Code: Select all

Val    f
Is output of numbers with floating point implemented in the library?
How I suppose to output them?

Re: MOD54415 iprintf() for float type problem

Posted: Tue Feb 26, 2013 11:57 am
by tony
You need to use printf. iprintf only handles integers.

Re: MOD54415 iprintf() for float type problem

Posted: Tue Feb 26, 2013 1:25 pm
by Arturino
Thanks, it worked.

Re: MOD54415 iprintf() for float type problem

Posted: Tue Feb 26, 2013 3:13 pm
by rnixon
The 'i' in iprintf() = integer. Adding floating point takes up a lot of space for those application that are space limited.

Re: MOD54415 iprintf() for float type problem

Posted: Tue Feb 26, 2013 4:40 pm
by Ridgeglider
same goes for the sprintf(() / siprintf functions and the preferred snprintf() / sniprintf variants