Created
February 14, 2019 13:50
-
-
Save SalesforceBobLightning/998da53bc148a7de8b564c77076246e1 to your computer and use it in GitHub Desktop.
Salesforce Apex Weight Converter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class WeightConverter { | |
private static final Decimal KILOGRAMS_TO_POUNDS_RATIO = 2.205; | |
public static Decimal kilogramsToPounds(Decimal kilograms) { | |
return kilograms * KILOGRAMS_TO_POUNDS_RATIO; | |
} | |
public static Decimal poundsToKilograms(Decimal pounds) { | |
return pounds / KILOGRAMS_TO_POUNDS_RATIO; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment