How can I get the thousand's separator and the decimal separator for the user's locale?

Godot Version

4.5-stable

Question

How do I get the thousand’s separator and the decimal separator for the user’s locale?

e.g., in America (en_US) we would write ten thousand and thirty cents like so: “10,000.30”.

In other places, they might write “10.000,30” or even “10 000,00”

Things I have figured out:

  • I can get the locale from OS.get_locale().
  • TextServer’s format_number() doesn’t seem to do anything for anything other than a few languages (not locale) like fa.
  • Godot seems to have ICU4C built in but I don’t see anyway to get a NumberFormat object out of it.

Thanks for the help!

As far as I’m aware it’s not possible to do that. You could search if a proposal has been made or open a new one here:

1 Like

Thanks! Found a proposal that is close enough and dropped my 2¢ in.