C
ChrisB
Hello:
I was wondering if there might be a more efficient way to handle number
formatting over a range of values:
switch(DecimalPlaces)
{
case 1:
formattedResult = result.ToString(".0");
break;
case 2:
formattedResult = result.ToString(".00");
break;
case 3:
formattedResult = result.ToString(".000");
break;
case 4:
etc.
}
I suppose the format string could be dynamically generated, but is there
possibly a more elegent way to accomplish the same task using .NET
non-custom formatting?
Thanks!
Chris
I was wondering if there might be a more efficient way to handle number
formatting over a range of values:
switch(DecimalPlaces)
{
case 1:
formattedResult = result.ToString(".0");
break;
case 2:
formattedResult = result.ToString(".00");
break;
case 3:
formattedResult = result.ToString(".000");
break;
case 4:
etc.
}
I suppose the format string could be dynamically generated, but is there
possibly a more elegent way to accomplish the same task using .NET
non-custom formatting?
Thanks!
Chris