Currency Field - Formatting with JSON

%3CLINGO-SUB%20id%3D%22lingo-sub-1514591%22%20slang%3D%22en-US%22%3ECurrency%20Field%20-%20Formatting%20with%20JSON%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1514591%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20everyone.%26nbsp%3B%20I%20am%20formatting%20a%20SharePoint%20On-Line%20list%20with%20JSON%20and%20have%20a%20column%20that%20is%20set-up%20in%20SharePoint%20as%20a%20'Currency'%20column.%26nbsp%3B%20In%20standard%20list%20view%20without%20any%20JSON%20applied%20it%20shows%20in%20proper%20%24XX%2CXXXX.XX%20format.%26nbsp%3B%20I'd%20like%20to%20get%20it%20shown%20the%20same%20way%20after%20I've%20applied%20JSON%20to%20the%20list%2C%20but%20can't%20seem%20to%20get%20it%20quite%20right.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EThe%20closest%20I%20can%20get%20is%20to%20manually%20ad%20a%20'%24'%20into%20the%20%22txtContent%22%20span%2C%20but%20it%20doesn't%20then%20show%20any%20of%20the%20comma%20delimiters%20or%20anything.%26nbsp%3B%20I've%20attached%20what%20I've%20done%20so%20far%20and%20what%20it%20results%20in.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIs%20there%20a%20better%20way%20for%20me%20to%20cost%20this%20into%20the%20JSON%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Annotation%202020-07-10%20103925.jpg%22%20style%3D%22width%3A%20644px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F204615i3EFA847D6E157245%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Annotation%202020-07-10%20103925.jpg%22%20alt%3D%22Annotation%202020-07-10%20103925.jpg%22%20%2F%3E%3C%2FSPAN%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22Annotation%202020-07-10%201039252.jpg%22%20style%3D%22width%3A%20190px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F204616iB5CCC5C67E8758E1%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20title%3D%22Annotation%202020-07-10%201039252.jpg%22%20alt%3D%22Annotation%202020-07-10%201039252.jpg%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1514591%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3ESharePoint%20Online%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1520525%22%20slang%3D%22en-US%22%3ERe%3A%20Currency%20Field%20-%20Formatting%20with%20JSON%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1520525%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F247199%22%20target%3D%22_blank%22%3E%40jdiorio%3C%2FA%3E%26nbsp%3B%2C%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhen%20you%20are%20using%20currency%20field%20in%20JSON%20formatting%20and%20concatenating%20some%20text%20to%20its%20value%20it%20gets%20converted%20to%20string.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAnd%20I%20don't%20think%20that%20there%20is%20any%20function%20supported%20by%20JSON%20formatting%20till%20now%20which%20will%20convert%20it%20back%20to%20currency%20and%20append%20the%20commas%20(%2C)%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Contributor

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?

 

Annotation 2020-07-10 103925.jpgAnnotation 2020-07-10 1039252.jpg

1 Reply

@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 (,)