How to change "Thousands separator" to "Ten Thousands separator"?

input: 1234567
current: 1,234,567
expect: 123,4567 or 123 4567

this code doesn’t work, still give me: 1,234,567
#,####

I can use this code:
#","####
but it has flaws. when there are not enough digits, the separator (comma) does not disappear.
123,4567 ← good
,123 ← bad

How to change “Thousands separator” to “Ten Thousands separator”?

I suppoase that you need to write your own formatting macro. And I suppose that the result will be a Text, therefore you will not able to use it for more calculations.

If the numbers are phone numbers or similar codes that aren’t really numbers but a string of digits, then you could use a Find and Replace as in this answer, How can I find and replace data with mask data in calc? ie Phone number masking last 4 digits - #2 by mikekaganski

I found a solution, insert two “conditions”.
[>=100000000]#","####","####;[>=10000]#","####;General

1 Like