eMi*_*eMi 2 java algorithm currency
我有:
int number = 1255; -> //It could also be 125(1€25Cent) or 10(10Cent) or 5(5Cent)
public double toMoney(int number)
{
...
}
Run Code Online (Sandbox Code Playgroud)
作为回报,我想要双号:12.55或如果输入:10然后:00.10
我知道我可以用Modulo这样做:
1255%100 ..得到55 ..但如何做到12和最后,如何形成一个双倍?