Help

Re: Floating Point Numbers display with too many trailing fractional digits

Solved
Jump to Solution
3529 0
cancel
Showing results for 
Search instead for 
Did you mean: 
David_Koontz
6 - Interface Innovator
6 - Interface Innovator

I’ve been trying to display a Currency US Dollars with the traditional 2 digit cents, e.g. $24.31

But Airtable is not honoring the formating that’s been specified for my Cost Bais field. WHY?

See the images

Screen Shot 2020-03-25 at 5.26.30 PM Screen Shot 2020-03-25 at 5.26.15 PM Screen Shot 2020-03-25 at 5.26.00 PM

Is there a way (easy) to make Airtable treat the floating point number as a dollar & cents figure?

1 Solution

Accepted Solutions
Jeremy_Oglesby
14 - Jupiter
14 - Jupiter

You can surround your reference to the {Cost Bias} field in a ROUND() function:

<the rest of your formula> ... & ROUND({Cost Bias}, 2)

As to this:

This is true for all number fields in Airtable - the formatting applied to number values of any type displayed in a field is just that – only formatting. Behind the formatted number, the fields are always holding a precise (exactly how precise I don’t know) float. It’s probably a good thing, as, in the long run, it provides the most flexibility and accuracy to calculations chained through multiple formula fields. And it gives you the control over when and how to round values.

See Solution in Thread

8 Replies 8
Jeremy_Oglesby
14 - Jupiter
14 - Jupiter

You can surround your reference to the {Cost Bias} field in a ROUND() function:

<the rest of your formula> ... & ROUND({Cost Bias}, 2)

As to this:

This is true for all number fields in Airtable - the formatting applied to number values of any type displayed in a field is just that – only formatting. Behind the formatted number, the fields are always holding a precise (exactly how precise I don’t know) float. It’s probably a good thing, as, in the long run, it provides the most flexibility and accuracy to calculations chained through multiple formula fields. And it gives you the control over when and how to round values.

And apparently not as precise as one might think.

Thank you @Jeremy_Oglesby & @Bill.French … Round() is a better solutions that the .32999999 but … if it’s not one thing … it’s another. Round() doesn’t abide the typical 167.00 e.g. dollar AND cents… see image.Screen Shot 2020-03-26 at 11.18.51 AM

David_Koontz
6 - Interface Innovator
6 - Interface Innovator

I dare say it but ol Fortran 77 had better formatting …

Formatting numbers in formulas that combine numbers and text has long been an issue.

Check out W_Vann_Hall’s pretty print routines.

WOW… Thanks @kuovonne - not sure I want a programming lecture along with the solutions…
I happen to know that Pretty Printing is a tough subject with lots of caveats.

Is there a short answer to incorporate those routines into my Base?

Said another way - I’m using Airtable - BECAUSE I don’t wish to HAVE to program solutions like Pretty Print.

@David_Koontz You can download the demo base, find the field with the formatting that you want, and then copy the formula. You will have to edit the formula slightly to fit your field names.

And the nightmare begins - coding pretty much everything a code-free environment. :winking_face: