Convert the floating-point number f to the corresponding string

Convert the floating-point number f to the corresponding string

topic

The function void ftoa(double f, char s[]) converts the floating-point number f into the corresponding string and stores it in s. This function can only convert up to four decimal places. For example, 123.45 will be converted to "123.45", − 123.456789 will be converted to "−123.4567".

Code (source code click here)

Insert picture description here

Guess you like

Origin blog.csdn.net/honeylife/article/details/101211765