mirror of
https://github.com/dankamongmen/notcurses
synced 2025-03-09 09:09:03 -04:00
add trivial new iprefix()
This commit is contained in:
parent
bc0016b827
commit
2e5a8b78d5
3
NEWS.md
3
NEWS.md
@ -10,6 +10,9 @@ rearrangements of Notcurses.
|
||||
more general form, capable of projecting arbitrary subregions of the source
|
||||
plane down to the destination plane. The source argument to
|
||||
`ncplane_mergedown_simple()` is now `const`.
|
||||
* `iprefix()` has been added, corresponding to `IPREFIXSTRLEN`. This ought
|
||||
be used if you want binary prefixes without the 'i' suffix indicating
|
||||
binary prefixes, which I predict will endear you to exactly no one.
|
||||
|
||||
* 1.6.15 (2020-08-16)
|
||||
* Styles now work properly with `ncdirect`, which apparently has never
|
||||
|
@ -2526,6 +2526,12 @@ qprefix(uintmax_t val, uintmax_t decimal, char* buf, int omitdec){
|
||||
return ncmetric(val, decimal, buf, omitdec, 1000, '\0');
|
||||
}
|
||||
|
||||
// Mibi, kebi, gibibytes sans 'i' suffix. Use IPREFIXSTRLEN + 1.
|
||||
static inline const char*
|
||||
iprefix(uintmax_t val, uintmax_t decimal, char* buf, int omitdec){
|
||||
return ncmetric(val, decimal, buf, omitdec, 1024, '\0');
|
||||
}
|
||||
|
||||
// Mibi, kebi, gibibytes. Use BPREFIXSTRLEN + 1.
|
||||
static inline const char*
|
||||
bprefix(uintmax_t val, uintmax_t decimal, char* buf, int omitdec){
|
||||
|
Loading…
x
Reference in New Issue
Block a user