summaryrefslogtreecommitdiffstats
path: root/lib/libutil/humanize_number.c
Commit message (Collapse)AuthorAgeFilesLines
* Add support for IEE/IEC (and now also SI) power of two notions ofdelphij2011-04-121-19/+32
| | | | | | | | | | prefixes (Ki, Mi, Gi...) for humanize_number(3). Note that applications has to pass HN_IEC_PREFIXES to use this feature for backward compatibility reasons. Reviewed by: arundel MFC after: 2 weeks
* humanize_number(3) multiply the input number by 100, which could cause andelphij2011-03-231-16/+24
| | | | | | | | | | | | integer overflow when the input is very large (for example, 100 Pi would become about 10 Ei which exceeded signed int64_t). Solve this issue by splitting the division into two parts and avoid the multiplication. PR: bin/146205 Reviewed by: arundel MFC after: 1 month
* Merge NetBSD revision 1.14: humanize_number.c is now 2-clause BSD licensed.delphij2009-06-231-8/+1
| | | | | | | (humanize_number.3 intentionally hold back until I make sure why we didn't merged dehumanize_number(3)). Obtained from: NetBSD
* Merge changes from NetBSD on humanize_number.c, 1.8 -> 1.13antoine2008-03-081-5/+10
| | | | | | | | | | | | | | Significant changes: - rev. 1.11: Use PRId64 instead of a cast to long long and %lld to print an int64_t. - rev. 1.12: Fix a bug that humanize_number() produces "1000" where it should be "1.0G" or "1.0M". The bug reported by Greg Troxel. PR: 118461 PR: 102694 Approved by: rwatson (mentor) Obtained from: NetBSD MFC after: 1 month
* Take the lastest fixes from NetBSD.pjd2004-09-251-63/+51
| | | | Obtained from: NetBSD
* Add humanize_number(3) to libutil for formating numbers into a humanpjd2004-05-241-0/+160
readable form. Obtained from: NetBSD
OpenPOWER on IntegriCloud