Files
bqst/test/test.typ
2025-12-21 15:38:31 +01:00

37 lines
902 B
Typst

#import "/src/lib.typ"
#import lib: qty, fmt-trim as fmt, fmt as f, op
#let example = q => [ #q => #fmt(qty(q)) ]
- #example("10 A")
- #example("10µA")
- #example("10microA")
- #example("10microamps")
- #example("10 amps")
- #example("amp")
- #example("10")
- #example("3.1415")
- #example("100")
- #example("100 milliA")
- #example("0")
- #example("10000000000000000000")
- #example("1.1")
// - #example("-1")
- #fmt((op.div)(qty("11"), qty("910")))
=== AAA
#let a = qty("volt")
#let b = qty("1000000000000000000000 amp")
#let a2 = qty("0.000000000000000000001 volt")
#let b2 = qty("amp")
- $#fmt(a) dot #fmt(b) = #fmt((op.mul)(a, b))$ (num is $#lib.num-trim((op.mul)(a, b))$ though)
- $#fmt(a2) dot #fmt(b2) = #fmt((op.mul)(a2, b2))$ (num is $#lib.num-trim((op.mul)(a2, b2))$ though)
=== BBB
- #fmt((op.div)(qty("1"), qty("ohm")))
- #fmt((op.sub)(qty("0"), (op.div)(qty("110"), qty("91"))))