How to maintain decimal percision in calculations
Posted
by Blankman
on Stack Overflow
See other posts from Stack Overflow
or by Blankman
Published on 2010-05-17T15:16:47Z
Indexed on
2010/05/17
15:20 UTC
Read the original article
Hit count: 262
I need to sum 2 decimal values together, then divide by 2 and convert to string.
My calculation currently is trimming to 2 decimal places, but I want to keep as many decimals as I can.
city.Latitude = ( (lat.North + lat.South) / 2 ).ToString();
the values for lat.North and lat.Souch are like: 55.32342322
© Stack Overflow or respective owner