Notifications
Clear all

[Closed] Formatting numbers for display?

How do I format numbers so they only show to a specific number of decimal places?

0.00 instead of -5.51557e-007

In other languages this would be done with a mask like #.## but I can’t see any documentation for anything like that in the format or print commands.

8 Replies

This was only recently added to Max 9, it was previously available in the free avguard plugin. (but you need to sell upgrades and licenses right!)

formattedPrint <value> format:<string>

It supports hash values like you asked about. Just check the docs.

What the h*** are you implying? That Larry is keeping the functions from his extension back so Autodesk can sell more copies?! How would that work if the functions are available for free anyway?
I am speechless.:sad:

I am not quite sure what you are talking about, but my comment was somewhat tongue in cheek. However, autodesk did state this in the manual

[color=red]NEW in [/color][color=red]3ds Max[/color][color=red][/color][color=red]9[/color][color=red]:[/color]The FormattedPrint method has been added to MAXScript in 3ds Max 9. It was previously available through the Avguard DLX Extensions.

“Previously available” makes it sound like it was acquired somehow, whereas something like “similar functionality to…” is different.

Anyway, it’s a welcome addition, as we try not to use any 3rd party tools/scripts/libs.

Bobo did you just sensor “heck”?

you know it’s a funny thing, people seem to treat autodesk as an enemy sometimes, like they’re trying to make peoples lives miserable or something. whenever someone has a problem or finds a bug they have a three paragraph rant at a web board talking about AD like they are some kind of big monster or something. I’ve always found them to be veruy helpful, although back in the day I did have some problems getting licensing issues work out before the adven tof te customer number.

J.

What is this free plugin?

I’m stuck using max8 because I can’t seem to get a working serial number from Autodesk for 9.

Autodesk? Autodesk does not write anything. PEOPLE working for Autodesk write things. The above paragraph was written by a person (me, to be exact) so people reading the help know they can use the same function in Max 8 and earlier if they have to by downloading the Avg. extensions.
Avguard.DLX is a structure of methods written by another persons – Larry Minton – who is the lead developer of MAXScript since Max 5, in his free time.
Whenever he writes something cool but does not have the time and resources to add to the next version of Max, he puts it in there. When the feature is stable, he moves it in the shipping product so it becomes in integral part of Max and does not require an additional download.

Your previous post read like yet another conspiracy theory about how Autodesk (and it’s black helicopters) are somehow trying to increase their sales by screwing their users. (which might happen otherwise, but not in this specific case)

Okay, I found AVg (7.0.9) but I’m having problems with it.

I can’t seem to get my numbers to 2 decimal places without getting scientific notation. How do I do it?

I can’t seem to figure out what the help file is saying.

1 Reply
(@bobo)
Joined: 11 months ago

Posts: 0

formattedPrint 0.12345 format:”.2f”
–>“0.12”

formattedPrint 0.12645 format:”.2f”
–>“0.13”

formattedPrint 1234567.12645 format:”.2f”
–>“1234567.13”