> For the complete documentation index, see [llms.txt](https://docs.dbnetsoft.com/dbnetsoft/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.dbnetsoft.com/dbnetsoft/raceresultexchange/operation-modes/displayboard/displayboard-brands/fds-mled/scripting/conditional-formatting-difftime.md).

# Conditional formatting difftime

The diff field from RR12 is captured in the variable diffString. Then it is checked if the string starts with a "-". If so, set the color variable to green, otherwise to red. After that the color is output together with the diff string and trimmed.

```
{{ 
diffString = "+1.45"
colorString = ""
if string.StartsWith diffString "-"
    colorString = "Green"
else 
    colorString = "Red"
end
(mled.Color colorString) + (TrimPad diffString 8 "Right")
}}
```
