If user enter on the keypad:
12.50 ( 1 2 dot 5 0 )
- How to format entered number so that it's 12.50 and not 1 2 . 5 0 or something in this matter ?
- How to process/calculate 12 dot 50 * 0.50 = 6.25
- How to write calculated value to ram ?
Regards.
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Thu May 14, 2009 12:58 am
Quote:
How to format entered number so that it's 12.50 and not 1 2 . 5 0 or
something in this matter ?
See this post:
http://www.ccsinfo.com/forum/viewtopic.php?t=36304&start=2
Except instead of atoi(), use the atof() function. It will convert
a string of ascii numbers into a floating point value. These functions
are described in the CCS manual, and on the internet (use Google).
Quote:
- How to process/calculate 12 dot 50 * 0.50 = 6.25
You now have the keypad value in a 'float' variable. Multiply it by 0.50
and store the result.
Quote:
- How to write calculated value to ram ?
You need to learn the C language. It's a pre-requisite for this forum.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum