Truncate Decimal Numbers without Rounding in C#

How to sanitize decimal numbers to the Nth decimal place without rounding.

For example, if you are dealing with crypto numbers like BTC (Bitcoin) or ETH (Etherium).

https://gist.github.com/Protiguous/14d51ba097783f249f1f3b441ed82674#file-sanitize-cs

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s