diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-09-20 22:59:46 +0100 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-09-20 22:59:46 +0100 |
| commit | 3bfaac08446e36caaf83fb2121abdbfeb04e261e (patch) | |
| tree | fbeabc6f08192caafc5b679ebbf651409bb3f7d0 /core/strconv.odin | |
| parent | 14d0cbf6d77e180fb752b468ad78aa3a689726fb (diff) | |
Fix decimal.odin assignment bug
Diffstat (limited to 'core/strconv.odin')
| -rw-r--r-- | core/strconv.odin | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/core/strconv.odin b/core/strconv.odin index 841d3805c..0bb158768 100644 --- a/core/strconv.odin +++ b/core/strconv.odin @@ -300,7 +300,7 @@ format_digits :: proc(buf: []u8, shortest: bool, neg: bool, digs: DecimalSlice, // integer, padded with zeros when needed if digs.decimal_point > 0 { m := min(digs.count, digs.decimal_point); - append(&buf, ...digs.digits[..m]); + append(&buf, ...digs.digits[0..m]); for ; m < digs.decimal_point; m += 1 { append(&buf, '0'); } @@ -320,7 +320,6 @@ format_digits :: proc(buf: []u8, shortest: bool, neg: bool, digs: DecimalSlice, append(&buf, c); } } - return buf; case 'e', 'E': |