资金支付 保留两位小数

public static void main(String[] args) {
       DecimalFormat format = new DecimalFormat("0.00");
       String abc ="100.456";
       String a = format.format(new BigDecimal(abc));
       System.out.println(a);
   }

decimal money1 = Decimal.Parse(parame[5].Value.ToString("#0.00"));

double d;   
double.Parse(String.Format("{0:N}",d)); 

double x = double.Parse("");
  double y = x % 0.01;
  double z = x - y;

decimal d = 46.28111;

string dStr = Math.Round( d,2 ).ToString();

结果:dStr == "46.28"

原文地址:https://www.cnblogs.com/DTWolf/p/4720742.html