Skip to content

Commit

Permalink
Specify English locale for Size and Duration units.
Browse files Browse the repository at this point in the history
  • Loading branch information
codahale committed May 2, 2013
1 parent f1e5c11 commit 8161db3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.google.common.base.CharMatcher;
import com.google.common.collect.ImmutableMap;

import java.util.Locale;
import java.util.concurrent.TimeUnit;
import java.util.regex.Pattern;

Expand Down Expand Up @@ -163,7 +164,7 @@ public int hashCode() {
@Override
@JsonValue
public String toString() {
String units = unit.toString().toLowerCase();
String units = unit.toString().toLowerCase(Locale.ENGLISH);
if (count == 1) {
units = units.substring(0, units.length() - 1);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.google.common.base.CharMatcher;
import com.google.common.collect.ImmutableMap;

import java.util.Locale;
import java.util.regex.Pattern;

import static com.google.common.base.Preconditions.checkArgument;
Expand Down Expand Up @@ -137,7 +138,7 @@ public int hashCode() {
@Override
@JsonValue
public String toString() {
String units = unit.toString().toLowerCase();
String units = unit.toString().toLowerCase(Locale.ENGLISH);
if (count == 1) {
units = units.substring(0, units.length() - 1);
}
Expand Down

0 comments on commit 8161db3

Please sign in to comment.