def Short.fixed

bend-kit-fmt@0.1.0.0 · fmt.bend:377

import bend-kit-fmt@0.1.0.0/fmt.bend as Fmt
import Base

377def Short.fixed(pos: Bool, +ds: String, +k: U32) -> String:
378  match pos:
379    case True{}:
380      +kn = {U32.to_nat(U32.sub(k, 64)) : Nat}
381      Short.fixed.big(Nat.is_ge(kn, String.length(ds)), ds, kn)
382    case False{}:
383      "0." ++ Fmt.fill(U32.to_nat(U32.sub(64, k)), '0') ++ ds

Uses (12)

Used by (1)