OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 [formatter.Get() setUsesGroupingSeparator:NO]; | 309 [formatter.Get() setUsesGroupingSeparator:NO]; |
310 | 310 |
311 RetainPtr<NSNumber> sample_number( | 311 RetainPtr<NSNumber> sample_number( |
312 kAdoptNS, [[NSNumber alloc] initWithDouble:9876543210]); | 312 kAdoptNS, [[NSNumber alloc] initWithDouble:9876543210]); |
313 String nine_to_zero([formatter.Get() stringFromNumber:sample_number.Get()]); | 313 String nine_to_zero([formatter.Get() stringFromNumber:sample_number.Get()]); |
314 if (nine_to_zero.length() != 10) | 314 if (nine_to_zero.length() != 10) |
315 return; | 315 return; |
316 Vector<String, kDecimalSymbolsSize> symbols; | 316 Vector<String, kDecimalSymbolsSize> symbols; |
317 for (unsigned i = 0; i < 10; ++i) | 317 for (unsigned i = 0; i < 10; ++i) |
318 symbols.push_back(nine_to_zero.Substring(9 - i, 1)); | 318 symbols.push_back(nine_to_zero.Substring(9 - i, 1)); |
319 ASSERT(symbols.size() == kDecimalSeparatorIndex); | 319 DCHECK(symbols.size() == kDecimalSeparatorIndex); |
320 symbols.push_back([formatter.Get() decimalSeparator]); | 320 symbols.push_back([formatter.Get() decimalSeparator]); |
321 ASSERT(symbols.size() == kGroupSeparatorIndex); | 321 DCHECK(symbols.size() == kGroupSeparatorIndex); |
322 symbols.push_back([formatter.Get() groupingSeparator]); | 322 symbols.push_back([formatter.Get() groupingSeparator]); |
323 ASSERT(symbols.size() == kDecimalSymbolsSize); | 323 DCHECK(symbols.size() == kDecimalSymbolsSize); |
324 | 324 |
325 String positive_prefix([formatter.Get() positivePrefix]); | 325 String positive_prefix([formatter.Get() positivePrefix]); |
326 String positive_suffix([formatter.Get() positiveSuffix]); | 326 String positive_suffix([formatter.Get() positiveSuffix]); |
327 String negative_prefix([formatter.Get() negativePrefix]); | 327 String negative_prefix([formatter.Get() negativePrefix]); |
328 String negative_suffix([formatter.Get() negativeSuffix]); | 328 String negative_suffix([formatter.Get() negativeSuffix]); |
329 SetLocaleData(symbols, positive_prefix, positive_suffix, negative_prefix, | 329 SetLocaleData(symbols, positive_prefix, positive_suffix, negative_prefix, |
330 negative_suffix); | 330 negative_suffix); |
331 } | 331 } |
332 } | 332 } |
OLD | NEW |