SA-MP Forums Archive
Sscanf float decimal numbers - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Sscanf float decimal numbers (/showthread.php?tid=415950)



Sscanf float decimal numbers - ReVo_ - 15.02.2013

How to approximate a float number when it is read by sscanf?

Number inside file: -819.46,1057.05,29.92
Stored: -819.460021 1057.050048 29.920000

I already tried "2.f" or something similar to specify how much decimal sscanf should take


Re: Sscanf float decimal numbers - Vince - 15.02.2013

What? You're not making any sense. You can only truncate decimals when you're outputting the value as a string.


Re: Sscanf float decimal numbers - ReVo_ - 15.02.2013

Oh, okay.
Thanks