Skip to content

Instantly share code, notes, and snippets.

Created April 17, 2015 04:05
Show Gist options
  • Save anonymous/36388d8e8d2608ee1c89 to your computer and use it in GitHub Desktop.
Save anonymous/36388d8e8d2608ee1c89 to your computer and use it in GitHub Desktop.
/**
* This method displays the given quantity value on the screen.
*/
private void displayPrice(int number) {
TextView priceTextView = (TextView) findViewById(R.id.price_text_view);
priceTextView.setText(NumberFormat.getCurrencyInstance().format(number));
}
@vidurtuli
Copy link

why my $ auto change to Rs.

@HansRA
Copy link

HansRA commented Jan 26, 2017

have a error help me please
private void displayPrice(int number) {
TextView priceTextView = (TextView) findViewById(R.id.lblprecio);
priceTextView.setText(NumberFormat.getCurrencyInstance().format(number));
}
error call requires API level 24 min 15
.getCurrencyInstance().format
my app min level 15

@izunnaa
Copy link

izunnaa commented Jun 7, 2017

hi, im still recieiving the number format error, any one know why?

@WaqarRaja
Copy link

after following and doing the fly box checked still error of number format is existing >.... any one help me plz

@ferbrett
Copy link

At this point, I have several errors in my code. first, the "Override" errors out and says that the "method does not override a method from its superclass". Then the onCreate(savedInstancesState) method errors out and states "cannot resolve method onCreate" it does the same for the setContentView method. A picture below shows the errors that I have.

capture

@IQ-Hammurabi
Copy link

if the auto import didn't import the NumberFormate ,try to click on the NumberFormate then press Alt+Enter keys from your Key board ,a list will appear, choose " import NumberFormate " from the list

@vipul1999
Copy link

vipul1999 commented Mar 2, 2019

click on NumberFormate
then press ALT + Enter
then import according to API

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment