我旁边的一个快速问题是,我编写了代码来突出显示特定情况下的单元格。
能否将其修改为以两位小数表示的百分比输出数字?
{
"$schema": "https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json <https://developer.microsoft.com/json-schemas/sp/column-formatting.schema.json> ",
"debugMode": true,
"elmType": "div",
"attributes":
{
"class": "=if(@currentField >= 0.5, 'sp-field-severity--good', if(@currentField >= 0.25,'sp-field-severity--warning', if(@currentField < 0.25,'sp-field-severity--blocked', ''))" },
"children": [
{
"elmType": "span",
"style":
{
"display": "inline-block",
"padding": "0 4px"
},
"attributes":
{
"iconName": "=if(@currentField == 'Scheduled','CheckMark', if(@currentField == 'In Process', 'Forward', if(@currentField == 'Cancelled', 'Error', if(@currentField == 'Rescheduled','Warning','')"
}
},
{
"elmType": "span",
"txtContent": "@currentField"
}
]
}