I have an amount stored in a decimal result:
Eg. decimal result = 1935698.27;
How can I format that to a String using .ToString() so that it looks like this: R 1 935 698,27
It needs to do the following:
- Add
R(take note of the space) to the front of theString - Add spaces to group the value in 3's (i.e
R 00 000 000 000,00) - Replace the
.with a,
This formats according to the South African Rand currency format.
This is what I have:
decimal result = 1935698.27;
string strResult = result.ToString("What should I put here?"); // Need help
// Expected strResult = "R 1 935 698,27"
Any help is much appreciated!