I recommend trying to write the code yourself. You have a lot of posts on these forums and most of the time you are looking for the community to write your code.
On the C# side it is simple as declaring a decimal type and applying a numeric format. See the docs.