Bifrost Forum
Welcome to the Bifrost Forum. This is the place for artists using Bifrost to ask and answer questions, browse popular topics, and share knowledge about creating effects procedurally using Bifrost. You can also visit the Bifrost Community on AREA to download an array of ready-to-use graphs, read Bifrost news and updates, and find the latest tutorials.
Showing results for 
Show  only  | Search instead for 
Did you mean: 

the new version of my format_numbers compound: support multiple inputs at the same time!

Message 1 of 2
382 Views, 1 Reply

the new version of my format_numbers compound: support multiple inputs at the same time!

g2m_format_numbers version 0.2


This compound converts numbers to strings, with decimal, round, padding, and prefix/suffix.
It's basically similar to this Python code:


inputNumber = 12.035
outputString = "%0.2f" % inputNumber  
#result: "12.04"


Unfortunately, it is not that simple in Bifrost. so I made this compound.
I hope that Bifrost will handle these things easily in the future.
more examples:
0 => "0.00"
15.5 => "15.50"
-0.3876 => "-0.39"
compound ports:
numbers: input numbers
has_decimal: decide how many decimal places to keep. 0: do not keep decimals; 1: keep one decimal place; 2: keep two decimal places. and so on. default is 2.
is_round: whether to round. default is True.
prefix: some string before the number. default is "" (empty string).
suffix: some string after the number, such as " %", this is the default value.
Labels (2)
Message 2 of 2
in reply to: g2m.agent

I noticed someone upvoting this old compound, this compound may not be stable, if you have such needs, please use my python plugin:


Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators

Autodesk Design & Make Report