[Mono-devel-list] Brazilian currency in Mono
Jurandy Martins Soares Junior
jurandy at lsd.ic.unicamp.br
Wed Oct 6 08:32:14 EDT 2004
> >I've tried to make Mono print a >>double<< as currency, using the format
> >of my country. See code below:
> >
> > double total = 7.50;
> > IFormatProvider formato = new CultureInfo("pt-br", true);
> > msg.Text = String.Format("{0:c}", total);
> >
> >It prints "R$8" rather than "R$7,50".
> >It rounds the value. In brazilian portuguese comma is the separator.
> >
> Well, the problem is that string.format doesn't know it should use
> 'formato'. Try this for example:
> msg.Text = String.Format("{0}", total.ToString("c", formato))
>
> Now, it should use the formatter to print the currency.
>
> Regards,
> Dave Mertens
Your solution didn't work. Indeed, there is a bug in the brazilian settings.
Regards,
Jurandy Martins
PS: I've already reported the bug in bugzilla. Thanks for all!
More information about the Mono-devel-list
mailing list