def pct_label

cswap-bend-cli@0.1.0.0 · tui/view.bend:22

import cswap-bend-cli@0.1.0.0/tui/view.bend as View
import 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)))

Uses (9)

Used by (2)