c# - startlat = (double)((int)(SECornerLat * 100) / 100.0); // does not work for 33.73 but otherwise fine -


i want have double 2 digits after decimal point

startlat = (double)((int)(secornerlat * 100) / 100.0); 

if secornerlat equal 33.73 startlat 33.72.

i tried multiple other numbers works fine returns wrong number 33.73.

same thing in floor(33.73*100)/100. 

this want:

double startlat = ((int) math.round((secornerlat * 100), 0) / 100.0); 

Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -