Forum Discussion

jdiorio's avatar
jdiorio
Copper Contributor
Jul 10, 2020

Currency Field - Formatting with JSON

Hi everyone.  I am formatting a SharePoint On-Line list with JSON and have a column that is set-up in SharePoint as a 'Currency' column.  In standard list view without any JSON applied it shows in proper $XX,XXXX.XX format.  I'd like to get it shown the same way after I've applied JSON to the list, but can't seem to get it quite right.

 

The closest I can get is to manually ad a '$' into the "txtContent" span, but it doesn't then show any of the comma delimiters or anything.  I've attached what I've done so far and what it results in.

 

Is there a better way for me to cost this into the JSON?

 

2 Replies

  • Zekiye's avatar
    Zekiye
    Copper Contributor

    jdiorio and for others like myself who have stumbled across this with the same question. If you add '.displayValue' to the end of the text content, it should preserve the original format. I used "@currentField.displayValue".

  • jdiorio ,

     

    When you are using currency field in JSON formatting and concatenating some text to its value it gets converted to string.

     

    And I don't think that there is any function supported by JSON formatting till now which will convert it back to currency and append the commas (,)