Re: str( number, width, presicion) function
- From: Arne Vajhøj <arne@xxxxxxxxxx>
- Date: Sun, 22 Apr 2007 18:55:04 -0400
Andrus wrote:
You got a reply here:
http://www.codeproject.com/script/comments/forums.asp?msg=2000862&forumid=1649#xx2000862xx
This recommends only to use Format() function.
Do you have any sample how to pass width and presicion to Format() function ?
Variable witdh and precision does not come natural for String Format,
but it is possible:
public static string Str(double number, ushort width, ushort precision)
{
return String.Format("{0," + width + ":f" + precision + "}", number);
}
Arne
.
- References:
- Re: str( number, width, presicion) function
- From: Göran Andersson
- Re: str( number, width, presicion) function
- From: Andrus
- Re: str( number, width, presicion) function
- Prev by Date: Re: readonly
- Next by Date: Re: Why doesn't C# allow incremental compilation like Java?
- Previous by thread: Re: str( number, width, presicion) function
- Next by thread: String Encryption Help
- Index(es):