Created
August 22, 2015 15:47
-
-
Save sharish/b4d777603195d35f7898 to your computer and use it in GitHub Desktop.
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 String getFormattedPrice(Resources resources) { | |
final String LAKH = "L"; | |
final String CRORE = "C"; | |
double value = getPrice(); | |
String rupees = resources.getString(R.string.rupee); | |
if (value >= 100) { | |
value = value / 100; | |
return rupees + FormatUtil.formatToStringDoublePrecision(value) + " " + CRORE; | |
} else { | |
return rupees + FormatUtil.formatToStringDoublePrecision(value) + " " + LAKH; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment