Friday 30 August 2019

c# - How to get short value using Double Function?











my double function generating values like this



  56,365989365



i want just value like this 56,36
how to get this ?


Answer



Use Math.Round. The second argument is the number of places.



var x = Math.Round(56.365989365, 2);

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...