Float round
#1

Hey guys i need help with floats.

I would like to get a float with only one digit, for example.

I got a float eg: 0.324861 and I want to get with round digits to one -> 0.3.

Anyone know how can i do that?
Reply
#2

https://sampwiki.blast.hk/wiki/Floatround
Reply
#3

It is not good for me because it is round to integer i want to round to float but only with one digit.
Reply
#4

Quote:
Originally Posted by Scofield62
Посмотреть сообщение
It is not good for me because it is round to integer i want to round to float but only with one digit.
Oh I apologise. I was mixing floatround with the C# function Math.Round, where you can specify decimals.

The only known way I can think of to do so atm is formatting a string with %.1f
Reply
#5

It worked Thank You!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)