我试图让每个变量打印出两位小数,但我不知道我做错了什么。有什么帮助吗?
System.out.printf("%.2",custNum + "\t" + beginBal + " \t " + financeCharge + "\t\t" +
purchases + " \t " + payments + "\t\t" + endBal);
答案 0 :(得分:1)
您的格式String
应为%.2f
,每个字词应为System.out.printf("%.2f\t%.2f\t%.2f\t%.2f\t%.2f\t%.2f%n", custNum, beginBal,
financeCharge, purchases, payments, endBal);
。像,
$ci = get_instance();
$ci->load->library('email');
$config['protocol'] = "smtp";
$config['smtp_host'] = "ssl://smtp.gmail.com";
$config['smtp_port'] = "465";
$config['smtp_user'] = "xxxxxxx@gmail.com";
$config['smtp_pass'] = "xxxxxxx";
$config['charset'] = "utf-8";
$config['mailtype'] = "html";
$config['newline'] = "\r\n";
$ci->email->initialize($config);