IEC/SI Binary Prefix Formatter
Hello guys, I'm wondering if in the Boost universe we already have something to format numbers according to IEC's "new" prefixes (such as MiB and GiB) or SI prefixes (such as MB and GB). What I'm looking for is something like: formatter << boost::iec_prefix << 5*1024*1024; // Will output "5 GiB" formatter << boost::si_prefix << 5*1024*1024; // Will output "5GB" Do you have anything like this? Thank you for your support, Rodrigo Madera
Hope nobody actually used my inputs for any test case! :-$
On Mon, Mar 2, 2009 at 3:20 PM, Ovanes Markarian
On Mon, Mar 2, 2009 at 7:00 PM, Rodrigo Madera
wrote: formatter << boost::iec_prefix << 5*1024*1024; // Will output "5 GiB"
formatter << boost::si_prefix << 5*1024*1024; // Will output "5GB"
Small correction, this should output 5 megs and not 5 gigs ;)
Ovanes
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Ovanes Markarian
-
Rodrigo Madera