RE: Controlling number of decimal places
From: atw13 (atw13_at_discussions.microsoft.com)
Date: 02/25/05
- Next message: Lars-Inge Tønnessen [VJ# MVP]: "Re: converting my J# application to Java"
- Previous message: atw13: "dragging"
- In reply to: Lou: "Controlling number of decimal places"
- Next in thread: Lars-Inge Tønnessen [VJ# MVP]: "Re: Controlling number of decimal places"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 24 Feb 2005 21:05:05 -0800
System.Decimal d = new System.Decimal(yourfloat);
String s = d.ToString("C");
The easiest way I see to do it is the above. Create a System.Decimal object
from your float, and then use the "c" argument in the toString method of
Decimal to format it as currency.
- Next message: Lars-Inge Tønnessen [VJ# MVP]: "Re: converting my J# application to Java"
- Previous message: atw13: "dragging"
- In reply to: Lou: "Controlling number of decimal places"
- Next in thread: Lars-Inge Tønnessen [VJ# MVP]: "Re: Controlling number of decimal places"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
Loading