Created
July 26, 2017 18:01
-
-
Save sachintha81/8878661b9bf872472e6be18da690859d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static string InsertThousandsSeparator(string input) | |
{ | |
var dec = decimal.Parse(input); | |
var bits = decimal.GetBits(dec); | |
var prec = bits[3] >> 16 & 255; | |
return dec.ToString("N" + prec); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment