Format number to local locale.

Change-Id: Iffa91eb8c40f09e5ac4cce10f355e348e62d8fce
Fixes: 78134172
Test: robotests
This commit is contained in:
Fan Zhang
2018-04-19 15:54:00 -07:00
parent 1257466d0b
commit 040df90c50
2 changed files with 23 additions and 17 deletions

View File

@@ -437,6 +437,16 @@ public class ApnEditorTest {
assertThat(str).isNull();
}
@Test
public void formatInteger_shouldParseString() {
assertThat(ApnEditor.formatInteger("42")).isEqualTo("42");
}
@Test
public void formatInteger_shouldIgnoreNonIntegers() {
assertThat(ApnEditor.formatInteger("not an int")).isEqualTo("not an int");
}
private void initCursor() {
doReturn(2).when(mCursor).getColumnCount();
doReturn(Integer.valueOf(2)).when(mCursor).getInt(CURSOR_INTEGER_INDEX);