Re: str( number, width, presicion) function

Tech-Archive recommends: Fix windows errors by optimizing your registry



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
.