float sp = 36.51647; sp=( (float)( (int)( (sp+0.005)*100 ) ) )/100; 挺实用的。double也可以。 转载于:https://www.cnblogs.com/airduce/p/9708795.html