#python计算结果百位500向下取整,(0-499取000,500-999取500)
!/usr/bin/env python
coding:utf-8
計算結果百位500向下取整,(0-499取000,500-999取500)
import math
calc_Amount = float(input("輸入所有可需金額:"))
act_Amount = calc_Amount
if calc_Amount > 0:
value2 = calc_Amount / 1000
value3 = math.floor(value2)
if (value2 - value3) < 0.5 and (value2 - value3) >= 0:
result = value31000
else:
result = (value3+0.5)1000
print(result)
else:
print(str(calc_Amount)+"數字有問題")
Java編寫
package org.learn.JavaLearn;
import java.lang.Math;
public class CalcBTXYApp {
// calc500round(11999.00);
// thirdjinwei(111.0922);
// applyrepayeach(5000,0.007,3);
CalcBTXYApp calcBTXYApp =new CalcBTXYApp();
System.out.println(calcBTXYApp.applyrepayeach(5000,0.007,3));
}
// System.out.println("借款申請頁每月應還:"+repayeach);
return repayeach;
}
// return Amount;
return nowrepayeach;
}
// System.out.println(amount);
return amount;
// System.out.println(result);
//return result;
}else {
System.out.println(calc_Amount+"金額數字有問題");
}
return result;
}
}
轉載于:https://www.cnblogs.com/ITniu/p/9089487.html
總結
以上是生活随笔為你收集整理的#python计算结果百位500向下取整,(0-499取000,500-999取500)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Java 语法 索引 ----- 泛型(
- 下一篇: Processing 字体变形