please provide your full code. you print out formatted oder discountAmount? why you parse again the formatted string back to discountAmount?
On 17 Mrz., 15:18, "[email protected]" <[email protected]> wrote: > Hi, > > I am having some problems correctly displaying currency. Here is the > code I am using: > > //Format the discount to two decimal places > NumberFormat fmt = NumberFormat.getCurrencyFormat(); > String formatted = fmt.format(discountAmount); > discountAmount = NumberFormat.getCurrencyFormat().parse(formatted); > > The discount amount field is set to some currency value for example > 2.58888. Now, it works fine if the value is set to 2 or more decimal > places, so it would format 2.58888 to 2.58. However, if the value is > intitial set to say 3, it formats the value to 3.0! > > Now, as I am using this to display the price of something, £3.0 is not > really much use. Can someone see where I am going wrong in my code or > if I need to add something?? > > Cheers, --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
