Andreas D Posted June 24, 2020 Share Posted June 24, 2020 Good Morning, i have a short question regarding the String Format Node in Marionette... can't get it working. Let's say i have a couple of Float Numbers (like 1.234, 2..345, 3.456...), already inside a Marionette Network. I want to format these with the "Format" Node in that way, that they always have either "+" or "-" and round them to let us say 2 digits. I know you can do this with other Nodes, but for now i would love to try it with the Format Node... Maybe you can give me a short example of how to use it. Thanks a lot Andreas Quote Link to comment
PatW Posted June 25, 2020 Share Posted June 25, 2020 (edited) Hi Andreas, For rounding the string use the placeholder {:+.2f} This placeholder combines 2 fromating types. See doc: https://www.w3schools.com/python/ref_string_format.asp Input: sFormat: "The Formated number is {:+.2f}" sArg: 9.99 outPut: "The Formated number is +10.00" regards, Patrick Edited June 25, 2020 by PatW Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.