Value.json.float: def of yaml-for-bend@0.1.1.0 Import: import yaml-for-bend@0.1.1.0/value.bend as Value Lines 280-286 of yaml-for-bend@0.1.1.0/value.bend: https://jend.leeeet.dev/read.txt?path=yaml-for-bend@0.1.1.0/value.bend&start_line=280&end_line=286 import Base # A float in JSON's form: "+.5e3" is 0.5e3; infinity and NaN stay as YAML # writes them, since JSON has no word for them. def json.float(+t: String) -> String: +neg = String.starts_with(t, "-") +body = Bool.pick(String, Bool.or(neg, String.starts_with(t, "+")), String.drop(t, 1n), t) Bool.pick(String, String.starts_with(body, "."), Bool.pick(String, Char.is_digit(Maybe.default(&2, Char, String.get(body, 1n), ' ')), Bool.pick(String, neg, "-0", "0") ++ zero.point(body), t), Bool.pick(String, neg, "-", "") ++ zero.point(body)) Uses (11): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.or https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool.pick https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Char https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Char.is_digit https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe.default https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.append https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.drop https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.get https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String.starts_with https://jend.leeeet.dev/definition.txt?path=yaml-for-bend@0.1.1.0/value.bend&name=zero.point