How to Truncate Decimal Numbers: A Guide for Make.com Users

Have you ever found yourself dealing with long decimal numbers that are dynamic and different, and you just can't get them to two decimals from your source? Well, you're not alone. This is a common challenge that many of us face. For instance, you might have a number like 1.232322323232 and you want to get 1.23. So, how do you go about it?

Step-by-Step Solution

The solution to this problem is simpler than you might think. You can use the formatNumber() function. Here's how:

{{formatNumber(1.232322323232; 2; “.”; emptystring)}}

This will round as well so something like 1.2353223 will result in 1.24.

If you don’t want the rounding and want to truncate instead you could try something like this:

{{substring(1.235322323232; 0; indexOf(1.235322323232; “.”) + 3)}}

This results in 1.23 instead of 1.24.

Troubleshooting Tips

If you're having trouble using the formatNumber function, it's important to note that the documentation on it is not very comprehensive. However, with a bit of practice and experimentation, you should be able to get the hang of it.

Conclusion

In conclusion, dealing with long decimal numbers doesn't have to be a headache. With the right tools and techniques, you can easily truncate or round your numbers to two decimals. Remember, practice makes perfect. So, don't be afraid to experiment with different solutions until you find the one that works best for you.

You do have further questions?

Ask your question via E-Mail: Richard@make-app.de
Book a paid Support & Consulting Session
New Make.com user? Sign up through this Affiliate Link to receive 10.000 operations for FREE.