java - What will be the format of the double -
i have 1 function i.e applycredit(double amount )
if calling function applycredit(inputamount)
and inputamount
in double 2 precision format i.e ####.00
if amount
in function got updated several times
and question : format of amount
2 precision or may changed of type double
as long can "fit in" input can or without decimals
public static void main(string[] args) { system.out.println(applycredit(2)); system.out.println(applycredit(2.66)); system.out.println(applycredit(2.72251)); } static private double applycredit(double amount ){ return amount*2; }
will print : 4.0 , 5.32 , 5.44502
Comments
Post a Comment