Home > DeveloperSection > Forums > Multiply percantage values
Nigel Bunyan
Nigel Bunyan

Total Post:20

Points:140
Posted on    December-08-2015 12:43 AM

 Java Java 
Ratings:


 1 Reply(s)
 273  View(s)
Rate this:
I need to multiply a double value by 12%, how can I do so?

public class AnnualMaintenanceFee {
  public void GetTotal(int TotalND) {
    double software=1500;
    double TNDWithSof= 1500+TotalND;
    double AMF= TNDWithSof 12;
    System.out.println("New Total: "+AMF);
  }
}


Mayank Tripathi
Mayank Tripathi

Total Post:397

Points:3117
Posted on    December-08-2015 1:12 AM

We can do it like this 

double AMF= TNDWithSof * 0.12; // 0.12 means 12/100(12%), you can use 0.12 directly
System.out.println("New Total: "+AMF);

Don't want to miss updates? Please click the below button!

Follow MindStick