Column formatting with Currency

%3CLINGO-SUB%20id%3D%22lingo-sub-278101%22%20slang%3D%22en-US%22%3EColumn%20formatting%20with%20Currency%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-278101%22%20slang%3D%22en-US%22%3E%3CP%3EHi%20There%20Everyone!%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20have%20started%20using%20the%20column%20formatting%20for%20some%20simple%20things%20but%20ran%20into%20my%20first%20speed%20bump.%20I%20have%20a%20calculated%20currency%20column%2C%20and%20my%20JSON%20formatting%20works%20just%20as%20I%20want%2C%20the%20only%20problem%20is%20the%20JSON%20formatting%20strips%20the%20currency%20format%20away.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3ECan%20someone%20point%20me%20in%20the%20right%20direction%20on%20how%20to%20format%20this%20column%3F%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%7B%3CBR%20%2F%3E%20%22%24schema%22%3A%20%22https%3A%2F%2Fdeveloper.microsoft.com%2Fjson-schemas%2Fsp%2Fcolumn-formatting.schema.json%22%2C%3CBR%20%2F%3E%20%22elmType%22%3A%20%22div%22%2C%3CBR%20%2F%3E%20%22attributes%22%3A%20%7B%3CBR%20%2F%3E%20%22class%22%3A%20%22%3Dif(%40currentField%20%26gt%3B%200%2C%20'sp-field-severity--blocked'%2C%20'')%22%3CBR%20%2F%3E%20%7D%2C%3CBR%20%2F%3E%20%22children%22%3A%20%5B%3CBR%20%2F%3E%20%7B%3CBR%20%2F%3E%20%22elmType%22%3A%20%22span%22%2C%3CBR%20%2F%3E%20%22style%22%3A%20%7B%3CBR%20%2F%3E%20%22display%22%3A%20%22inline-block%22%2C%3CBR%20%2F%3E%20%22padding%22%3A%20%220%204px%22%3CBR%20%2F%3E%20%7D%2C%3CBR%20%2F%3E%20%22attributes%22%3A%20%7B%3CBR%20%2F%3E%20%22iconName%22%3A%20%22%3Dif(%40currentField%20%26gt%3B%200%2C%20'Error'%2C%20'')%22%3CBR%20%2F%3E%20%7D%3CBR%20%2F%3E%20%7D%2C%3CBR%20%2F%3E%20%7B%3CBR%20%2F%3E%20%22elmType%22%3A%20%22span%22%2C%3CBR%20%2F%3E%20%22txtContent%22%3A%20%22%40currentField%22%3CBR%20%2F%3E%20%7D%3CBR%20%2F%3E%20%5D%3CBR%20%2F%3E%7D%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-278101%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EColumn%20Formatting%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Highlighted
Contributor

Hi There Everyone!

 

I have started using the column formatting for some simple things but ran into my first speed bump. I have a calculated currency column, and my JSON formatting works just as I want, the only problem is the JSON formatting strips the currency format away. 

 

Can someone point me in the right direction on how to format this column?

 

{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json",
"elmType": "div",
"attributes": {
"class": "=if(@currentField > 0, 'sp-field-severity--blocked', '')"
},
"children": [
{
"elmType": "span",
"style": {
"display": "inline-block",
"padding": "0 4px"
},
"attributes": {
"iconName": "=if(@currentField > 0, 'Error', '')"
}
},
{
"elmType": "span",
"txtContent": "@currentField"
}
]
}
0 Replies