From a60b85b538c9131869bde5e5e196f6aa23763090 Mon Sep 17 00:00:00 2001 From: Denis Chevalier Date: Mon, 10 Aug 2026 22:34:36 +0200 Subject: rename assert_aeq.typ and apply_prefix.typ s/_/-/ --- lib/apply-prefix.typ | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 lib/apply-prefix.typ (limited to 'lib/apply-prefix.typ') diff --git a/lib/apply-prefix.typ b/lib/apply-prefix.typ new file mode 100644 index 0000000..f6bbfb7 --- /dev/null +++ b/lib/apply-prefix.typ @@ -0,0 +1,12 @@ +#let apply-prefix(value, prefix) = { + if prefix == "tera" { return value * calc.pow(10, 12) } + if prefix == "giga" { return value * calc.pow(10, 9) } + if prefix == "mega" { return value * calc.pow(10, 6) } + if prefix == "kilo" { return value * calc.pow(10, 3) } + if prefix == "milli" { return value * calc.pow(10, -3) } + if prefix == "micro" { return value * calc.pow(10, -6) } + if prefix == "nano" { return value * calc.pow(10, -9) } + if prefix == "pico" { return value * calc.pow(10, -12) } + if prefix == "femto" { return value * calc.pow(10, -15) } + return value +} -- cgit