Skip to content

Commit

Permalink
Fix string format in CardOperations.getTravelCardValue
Browse files Browse the repository at this point in the history
  • Loading branch information
vtainio committed Aug 2, 2015
1 parent c454b16 commit de984a7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/com/hsl/example/CardOperations.java
Expand Up @@ -526,8 +526,8 @@ else if (currentCal.before(periodEndCal1) && currentCal.after(periodStartCal1))
public static String getTravelCardValue(TravelCard card)
{
//Calculate euros and cents out of value counter
String euros = String.valueOf (card.getValueCounter() / 100);
String cents = String.valueOf (card.getValueCounter() % 100);
int euros = card.getValueCounter() / 100;
int cents = card.getValueCounter() % 100;

//Build string, cents with 2 digits and leading zeros. Add euro-character at the end.
String value = String.format("%d.%02d \u20ac",euros,cents);
Expand Down

0 comments on commit de984a7

Please sign in to comment.