Skip to main content
Solved

Floating Point Numbers display with too many trailing fractional digits

  • March 25, 2020
  • 8 replies
  • 83 views

Forum|alt.badge.img+1

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

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

Best answer by Jeremy_Oglesby

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.

8 replies

Forum|alt.badge.img+18

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.


Forum|alt.badge.img+19
  • Inspiring
  • March 26, 2020

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.


Forum|alt.badge.img+1
  • Author
  • Known Participant
  • March 26, 2020

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.


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.


Forum|alt.badge.img+1
  • Author
  • Known Participant
  • March 26, 2020

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


kuovonne
Forum|alt.badge.img+29
  • Brainy
  • March 26, 2020

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

Check out W_Vann_Hall’s pretty print routines.


Forum|alt.badge.img+1
  • Author
  • Known Participant
  • March 26, 2020

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.


kuovonne
Forum|alt.badge.img+29
  • Brainy
  • March 26, 2020

@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.


Forum|alt.badge.img+19
  • Inspiring
  • March 26, 2020

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.


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