Boost logo

Boost :

From: Stefan Slapeta (stefan_nospam__at_[hidden])
Date: 2004-09-06 12:26:36

Pavel Vozenilek wrote:

> Question: how much does it overlap with functionality of Boost.Format?

I would say: not at all; boost.format is a replacement for printf to
make it typesafe - there's not much more about numeric formatting than
in std C.

However, custom numeric formatting could be included into boost.format,
though this wouldn't be the usual approach as in other languages. I
would go this way and add an optional parameter in boost::lexial_cast
which would result in a syntax similar to .NET and Java:

string s = lexical_cast<std::string>(1231.23, "#,#.00");

Support for numeric format strings is part of the libraries of many
common programming languages (e.g. Java and .NET). Although they differ
a little bit over the different implementations, I think there is a
common base which I tried to implement.


Boost list run by bdawes at, gregod at, cpdaniel at, john at