lordofduct
Well-known member
- Joined
- Jun 24, 2010
- Messages
- 71
- Programming Experience
- 3-5
So I need a format string to pass to String.Format that would "move" the decimal point.
I can't perform any math operations before doing the String.Format, so it has to work right off the bat.
Basically I'm emulating a formatting string from a proprietary server. In it if I say:
"MR2"
for the value:
12345
The result is:
123.45
I'm close with this, but it's not spot on:
String.Format("{0:#0\.##}", 12345)
an extra, but not necessary... there is also MR2Z, which moves the decimal 2 left, but if the value is 0 "" is returned. I don't really need that, but it'd be nice.
I can't perform any math operations before doing the String.Format, so it has to work right off the bat.
Basically I'm emulating a formatting string from a proprietary server. In it if I say:
"MR2"
for the value:
12345
The result is:
123.45
I'm close with this, but it's not spot on:
String.Format("{0:#0\.##}", 12345)
an extra, but not necessary... there is also MR2Z, which moves the decimal 2 left, but if the value is 0 "" is returned. I don't really need that, but it'd be nice.