Skip to content

Instantly share code, notes, and snippets.

@sharish
Created August 22, 2015 15:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sharish/b4d777603195d35f7898 to your computer and use it in GitHub Desktop.
Save sharish/b4d777603195d35f7898 to your computer and use it in GitHub Desktop.
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