Format Text (formatting numbers and dates)

How do I format a date or a number using blueprints?

For example in c# I can use string.Format(“{0:HH:mm}”, MyDateTime) to specify how I want the date to be formatted. Similarly, how do I format a float with leading zeros. “#0.00”?

HI Kev
You’ve got Time Seconds to String, which add leading zeros.

Ah sorry re-read your post and I don’t think this helps because you need date

You can make a date time object and output that to text or string

1 Like

Thanks for the help, but I’m looking for a way to specify the format of converted strings. The Format Text node is kind of what I was looking for, but I don’t think it allows you to specify how the value will appear after it is converted.

For example, lets say I have a float and I want it to appear in the format 0.00. I want the value of .354202 to appear as 0.35. Likewise if I have a datetime variable I want to format the date to YYYY-MM-DD. Sure, I can build the string the long way ,but I was just wondering if there is a built in format method.

Screenshot 2020-09-30 100638.jpg

Also, look into the datetime variables, they spit out all kind of goodness:

Screenshot 2020-09-30 100748.jpg

Then you can format it any way you need:

Screenshot 2020-09-30 101000.jpg

2 Likes