Hello guys!
Problem with LCD indication:
If I need out to LCD float = 0.001 by the follow function:
void Write_LCD(unsigned char row, unsigned char col,float tmp_var)
{
char tmp_string[14];
FloatToStr(tmp_var,tmp_string);
Lcd8_Custom_Out(row,col,tmp_string);
}
then I will see on LCD: "1e-3"
But I need to see "0.001" !!
How I can do that, please?
Thank you for your answer
Have a nice day!
LCD float out problem
LCD float out problem
___________________________________________
http://www.techno-spectr.ru/en/main-en/
Yaroslavl, Russia
http://www.techno-spectr.ru/en/main-en/
Yaroslavl, Russia
- tihomir.losic
- mikroElektronika team
- Posts: 2138
- Joined: 02 Dec 2009 14:16
- Location: Serbia
- Contact:
Re: LCD float out problem
Hello,
if you are using
Converts a floating point number to a string. The output string is left justified and null terminated after the last digit.
example:
It's not recommended to use this function if you want the output like "0.001".
Suggestion is that you use library sprintf!
The function returns the number of characters actually written to destination string.
For more informations, look for sprintf in our help file.
If you have any additional questions, feel free to contact me.
Best regards,
Losic Tihomir
if you are using
Code: Select all
FloatToStr(tmp_var,tmp_string);
example:
Code: Select all
float ff3 = 0.000001234;
.
.
.
FloatToStr(ff3, txt); // txt is "1.234e-6"
Suggestion is that you use library sprintf!
The function returns the number of characters actually written to destination string.
For more informations, look for sprintf in our help file.
If you have any additional questions, feel free to contact me.
Best regards,
Losic Tihomir
mikroElektronika [Support team]
Re: LCD float out problem
Thank you my friend!
I will trying
Best regards!
I will trying
Best regards!
___________________________________________
http://www.techno-spectr.ru/en/main-en/
Yaroslavl, Russia
http://www.techno-spectr.ru/en/main-en/
Yaroslavl, Russia