-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 What about the attached diff to ByteCount.cc as part of fixing https://bugzilla.novell.com/show_bug.cgi?id=471335 ? Note the empty 'symbol' for Byte - this way users can just do: ByteCount bytes; cout << "Size: " << bytes << "B" << endl; // OR cout << str::form("Size: %sB", bytes.asString(0,1,1)) << endl; //OR cout << str::form("Size: %sbit", bytes.asString(0,1,1)) << endl; // etc. to get "Size: 13 B" "Size: 13 KiB" "Size: 13 MiB" "Size: 13 Mibit" (plus the decimal variants) etc... without need for if (bytes.bestUnit().factor() == ByteCount::B.factor()) cout << str::form("Size: %s", bytes.asString(0,1,1)); else cout << str::form("Size: %sB", bytes.asString(0,1,1)); - -- cheers, jano Ján Kupec YaST team - ---------------------------------------------------------(PGP)--- Key ID: 637EE901 Fingerprint: 93B9 C79B 2D20 51C3 800B E09B 8048 46A6 637E E901 - ---------------------------------------------------------(IRC)--- Server: irc.freenode.net Nick: jniq Channels: #zypp #yast #suse #susecz - ---------------------------------------------------------(EOF)--- -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.9 (GNU/Linux) Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org iEYEARECAAYFAkmK/38ACgkQgEhGpmN+6QEyHQCfRNz+fo4ICWNlTlo1MSfM5LpF fUQAn2L8yBOoItnFtHLCTNt8qU23v87L =AjsE -----END PGP SIGNATURE-----