Floating Points
Posted: Sat Jan 19, 2019 4:33 pm
Hi Leigh,
Hope all is well!,
I need some help with a floating point please.., somehow I can't seem to get the second decimal.(I get just .0)
I have a very simple routine look at an interrupt on the Standard PIC MIAC and I am using I8 with RB2
I have a calculation counting my pulses (working 100%),
I then have a calculation of a Floating Point dividing my pulses (count variable so I can see the exact litres like 2.5L when I get 5 pulses) and I then convert the floating point variable to a string showing a single decimal place. When I read 5 pulse I get 2.0 so something is not right,
Any ideas where I have gone wrong?, code attached..
Regards,
Gavin
Hope all is well!,
I need some help with a floating point please.., somehow I can't seem to get the second decimal.(I get just .0)
I have a very simple routine look at an interrupt on the Standard PIC MIAC and I am using I8 with RB2
I have a calculation counting my pulses (working 100%),
I then have a calculation of a Floating Point dividing my pulses (count variable so I can see the exact litres like 2.5L when I get 5 pulses) and I then convert the floating point variable to a string showing a single decimal place. When I read 5 pulse I get 2.0 so something is not right,
Any ideas where I have gone wrong?, code attached..
Regards,
Gavin