Scan.unit: def of gralha-text-scan@0.1.0.1 Import: import gralha-text-scan@0.1.0.1/scan.bend as Scan Lines 257-266 of gralha-text-scan@0.1.0.1/scan.bend: https://jend.leeeet.dev/read.txt?path=gralha-text-scan@0.1.0.1/scan.bend&start_line=257&end_line=266 import Base def unit(num: Number, reference: F32) -> F32: Number{x, t, ok} = num +v = x +u = t (v * choose(F32, prefix(u, "%"), (reference / 100.0 : F32), choose(F32, prefix(u, "in"), 96.0, choose(F32, prefix(u, "cm"), 37.7952755906, choose(F32, prefix(u, "mm"), 3.77952755906, choose(F32, prefix(u, "pt"), 1.333333333333, choose(F32, prefix(u, "pc"), 16.0, 1.0)))))) : F32) Uses (6): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.div https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.mul https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=Number https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=choose https://jend.leeeet.dev/definition.txt?path=gralha-text-scan@0.1.0.1/scan.bend&name=prefix