Mity Eltu
Member
I am writing a program that will be using a few single precision floating point variables. I will need to print these variables to an LCD module. I have been using the LCDOUT command in the following manner to do this:
The LCD displays this "i= 9.424". What I need/want is to have 9.4245 displayed (the actual correct answer).
The problem with this is that I need more than the 3 decimal places that it displays on the LCD. From the manual I get that the Single precision variables have 7 digit precision. Is there a way to get more decimal places out of these variables without resorting to brute force (ie strip off the integer part, multiply by big scaling factor and then display both parts)?
Code:
main:
Dim a1 As Single
Dim b1 As Single
Dim c1 As Single
Gosub setup
Lcdinit
Lcdcmdout LcdClear
a1 = 3.1415
b1 = 1.5
c1 = 2 * a1 * b1
Lcdout "i= ", #c1
The LCD displays this "i= 9.424". What I need/want is to have 9.4245 displayed (the actual correct answer).
The problem with this is that I need more than the 3 decimal places that it displays on the LCD. From the manual I get that the Single precision variables have 7 digit precision. Is there a way to get more decimal places out of these variables without resorting to brute force (ie strip off the integer part, multiply by big scaling factor and then display both parts)?