You should add formatted="false"
to your string resource
Here is an example
In your strings.xml
:
<string name="all" formatted="false">Amount: %.2f%n for %d days</string>
In your code:
yourTextView.setText(String.format(getString(R.string.all), 3.12, 2));