def pct_label
import cswap-bend-cli@0.1.0.0/tui/view.bend as Viewimport Base
import cswap-bend-cli@0.1.0.0/tui/fmt.bend as F
22# 9000 -> "90", 8550 -> "85.5", 8505 -> "85.05".
23def pct_label(+c: U32) -> String:
24 F.sel.s(U32.is_eq((c % 100 : U32), 0), U32.show((c / 100 : U32)), U32.show((c / 100 : U32)) ++ "." ++ frac2((c % 100 : U32)))