How do I chance the decimal separator?

:bullseye: What is your goal?

Hello, I’ve started learning Make in the Academy and I’m up to the point where we learn formatNumber(1.cost; 2; “,”; “.”), however, the return is always 150.000,00. How do I change it to 150,000.00? I’ve read that it defaults to the European format and the locale has something to do with it. The thing is, my locale and organization is already set to my country (Philippines, which is similar to the US format)

:thinking: What is the problem?

My scenario runs but uses the default format of 150.000,00. instead of 150,000.00. I’m using this formula formatNumber(1.cost; 2; “,”; “.”).

:test_tube: What have you tried so far?

I’ve tried made sure my locale, country, and organization if it’s correct. I’ve tried interchanging . and , but that didn’t fix it.

:camera_with_flash: Screenshots: scenario setup, module configuration, errors

Welcome to the Make community!

You have the parameters mixed up.

To do this, you can use the built-in function:

  • formatNumber
    formatNumber(number; numDecimals; [decimalSeparator]; [thousandsSeparator])

This function may have also been covered in the Make Academy tutorials — refer to the Make Academy Course Overview to learn more.

Here’s an example of how you can use this function:

{{ formatNumber(150000; 2; "."; ",") }}   or
{{ formatNumber(1.cost; 2; "."; ",") }}

(copy-paste the above into the field, or type it exactly as shown)

Hope this helps! If you are still having trouble, please provide more details.

@samliew
P.S.: investing some effort into the tutorials in the Make Academy will save you lots of time and frustration using Make!

Thanks for getting back to me. I’ve already tried your suggestion prior to asking and it just doesn’t work for me, am I missing something? This {{formatNumber(1.cost; 2; “.”; “,”)}} returns as this 150000 (no separators at all). Please be patient with me, I’m new to this.

As advised by @samliew that’s the correct function. Please share a screenshot of how you’ve implemented it. There is no way of knowing if you’ve done it correctly or incorrectly.

Sharing the screenshots, as you can see in Sheet, I’ve experimented on different formulas.

I’ve been following this in Make Academy: https://academy.make.com/courses/take/BasicsC03/multimedia/44140486-unit-5-transforming-data-formatnumber and it even says the same thing, see screenshot. I don’t see in the module where it explains why it behaves like that and how to force it to be the other way around.

You have the separators in reverse. Please note that this is the function.
formatNumber(number; numDecimals; decimalSeparator; thousandsSeparator)

Your function should look like this:
{{ formatNumber(1.cost; 1; “.”; “,”) }}
{{ formatNumber(1.cost; 2; “.”; “,”) }}

Note: Check the cell format on Google Sheets as well.

Let me know how it goes!

1 Like

I got it to work! As you’ve both mentioned, it was the other way around. But I wasn’t getting the correct result until you’ve pointed out the format in Sheet. As soon as I’ve dealt with that, it fixed it. Thanks!

1 Like

You’re welcome! I’m glad your problem has been resolved.