ref: fc5907f1358e5110487318816915f3f87aa274f4
parent: b3e754a93b3866d3eda4441a7e6708a71969a423
author: Ori Bernstein <[email protected]>
date: Tue Sep 16 22:09:41 EDT 2014
Add support for relative cutoffs.
--- a/libstd/floatfmt.myr
+++ b/libstd/floatfmt.myr
@@ -113,10 +113,12 @@
bigfree(u)
;;
;;
- match mode
- | 0:
+ if mode == 0
cutoff = k - buf.len - 1
- | 1:
+ else
+ if mode == 2
+ cutoff += k
+ ;;
a = cutoff - k
y = bigdup(s)
if a < 0
@@ -139,9 +141,9 @@
| `Before: /* nothing */
| _:
bigfree(mp)
- mm = y
+ mp = y
+ roundup = true
;;
- | 2:
;;
u = bigdup(s)
bigshli(u, 1)