mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-28 02:03:59 +00:00
Reimplementation of formatSize to return a more meaningful value (fixes #4198).
This commit is contained in:
@@ -50,6 +50,11 @@ Changes affecting backwards compatibility
|
||||
than changing the operation for even and odd numbers.
|
||||
- The ``round`` function now accepts a ``places`` argument to round to a
|
||||
given number of places (e.g. round 4.35 to 4.4 if ``places`` is 1).
|
||||
- In ``strutils.nim``, ``formatSize`` now returns a number representing the
|
||||
size in conventional decimal format (e.g. 2.234GB meaning 2.234 GB rather
|
||||
than meaning 2.285 GB as in the previous implementation). By default it
|
||||
also uses IEC prefixes (KiB, MiB) etc and optionally uses colloquial names
|
||||
(kB, MB etc) and the (SI-preferred) space.
|
||||
|
||||
|
||||
Library Additions
|
||||
@@ -63,6 +68,8 @@ Library Additions
|
||||
versions are for ``char`` and ``set[char]``.
|
||||
- Added ``splitDecimal`` to ``math.nim`` to split a floating point value
|
||||
into an integer part and a floating part (in the range -1<x<1).
|
||||
- Added ``trim`` argument to ``formatFloat`` in ``strutils.nim`` to trim
|
||||
trailing zeros.
|
||||
|
||||
|
||||
Compiler Additions
|
||||
|
||||
Reference in New Issue
Block a user