def fmt.val

cswap-bend-cli@0.1.0.0 · setwrite.bend:199

import cswap-bend-cli@0.1.0.0/setwrite.bend as Setwrite
import Base
import cswap-bend-cli@0.1.0.0/json.bend as Json
import cswap-bend-cli@0.1.0.0/settings.bend as Settings

199# format_setting_value
200def fmt.val(isfloat: Bool, j: Json.Json) -> String:
201  match j:
202    case Json.JNull{}:
203      "(none)"
204    case Json.JBool{b}:
205      Settings.sel.s(b, "true", "false")
206    case Json.JNum{t}:
207      fmt.num(isfloat, t)
208    case Json.JStr{s}:
209      s
210    case _:
211      ""

Uses (5)

Used by (3)