Skip to main content
Solved

How can the final result of the formula be converted to a numeric value with 2 decimal places

  • February 16, 2022
  • 4 replies
  • 59 views

Forum|alt.badge.img+9

Hi
Can airtable fulfill my requirement? Please see the picture for specific examples. I need to reserve two decimal digits in the column of “Original Price” in the picture

Best answer by Andy_Lin1

Since your formula outputs a string, you need to convert it to a value first (see below) and then you’ll be able to use the Formatting tab to set the number of decimal places.

VALUE(REGEX_REPLACE({T. price Rollup},',.*',""))

4 replies

Dimitris_Goudis
Forum|alt.badge.img+20

Hey @Vijay_chen,

your roll up field “T. Price Rollup” returns a list of values that are separated with comma and dot are the symbol for the decimal numbers. In your formula as I guess you try to replace all those symbols right and create a consequence of all those values in text. Is that right?

Thanks


Forum|alt.badge.img+17
  • Inspiring
  • Answer
  • February 16, 2022

Since your formula outputs a string, you need to convert it to a value first (see below) and then you’ll be able to use the Formatting tab to set the number of decimal places.

VALUE(REGEX_REPLACE({T. price Rollup},',.*',""))


Forum|alt.badge.img+9
  • Author
  • Known Participant
  • February 17, 2022

Hey @Vijay_chen,

your roll up field “T. Price Rollup” returns a list of values that are separated with comma and dot are the symbol for the decimal numbers. In your formula as I guess you try to replace all those symbols right and create a consequence of all those values in text. Is that right?

Thanks


Yes, and downstairs came up with a solution. Thank you


Forum|alt.badge.img+9
  • Author
  • Known Participant
  • February 17, 2022

Since your formula outputs a string, you need to convert it to a value first (see below) and then you’ll be able to use the Formatting tab to set the number of decimal places.

VALUE(REGEX_REPLACE({T. price Rollup},',.*',""))


This is exactly what I need. Thank you very much