crazy-igzp
Member level 1
- Joined
- Feb 3, 2014
- Messages
- 34
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 6
- Location
- Settat, Morocco
- Activity points
- 255
I am helping a friend with a small electronics project using a PIC microcontroller 16F877 (A) which I am programming with mikroC.
I have run into a problem which is that I have a floating point number in a variable lets say for example 1234.123456 and need to split it out into variables holding each individual number so I get Char1 = 1, Char2=2 etc etc. for display on LCD. The number will always be rounded to 3 or 4 decimal places so there should be a need to track the location of the decimal point.
Any advice on how to get this split would be greatly appreciated.
I have run into a problem which is that I have a floating point number in a variable lets say for example 1234.123456 and need to split it out into variables holding each individual number so I get Char1 = 1, Char2=2 etc etc. for display on LCD. The number will always be rounded to 3 or 4 decimal places so there should be a need to track the location of the decimal point.
Any advice on how to get this split would be greatly appreciated.