Rounding floats to a set number of significant figures

Rounding floats to a set number of significant figures

ClaudioAlvaro
Contributor Contributor
249 Views
2 Replies
Message 1 of 3

Rounding floats to a set number of significant figures

ClaudioAlvaro
Contributor
Contributor
I've been looking for a function that can do this and it seems there isn't any (at least not outlined in the help). I also searched these forums to no avail...

We've got a function doing this but it is painfully slow, especially when the resulting value is in exponential notation as it needs to parse it as a string.

Anyone know how I can do this without sucking all of my computer's valuable juice?

CL Audio
3dsMax 2009 SP1
---
3DSMax 2012 SP2
0 Likes
250 Views
2 Replies
Replies (2)
Message 2 of 3

Steve_Curley
Mentor
Mentor
formattedPrint <value> format:"format string"

The "format string" is very similar to those used in the standard printf routine in C.


Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

0 Likes
Message 3 of 3

ClaudioAlvaro
Contributor
Contributor
Thanks Steve!
---
3DSMax 2012 SP2
0 Likes