Index: chrome/browser/resources/print_preview/margin_settings.js |
diff --git a/chrome/browser/resources/print_preview/margin_settings.js b/chrome/browser/resources/print_preview/margin_settings.js |
index 3e9063986ab8db1c1a27369f3e707982682890c2..de4f18cd9528e08136b3d4e1ec1092ce4c915b76 100644 |
--- a/chrome/browser/resources/print_preview/margin_settings.js |
+++ b/chrome/browser/resources/print_preview/margin_settings.js |
@@ -167,16 +167,16 @@ cr.define('print_preview', function() { |
/** |
* Extracts the number formatting and measurement system for the current |
* locale. |
- * @param {string} numberFormat Is the formatted version of a sample number, |
- * sent from the backend. |
+ * @param {string} numberFormat Is the formatted version of the sample number |
+ * 12345678 sent from the backend. |
* @param {number} measurementSystem 0 for SI (aka metric system), 1 for the |
* system used in the US. Note: Mathces UMeasurementSystem enum in |
* third_party/icu/public/i18n/unicode/ulocdata.h. |
*/ |
MarginSettings.setNumberFormatAndMeasurementSystem = function( |
numberFormat, measurementSystem) { |
- var regex = /^(\d+)(\.|\,)(\d+)(\.|\,)(\d+)$/; |
- var matches = numberFormat.match(regex); |
+ var regex = /^(123)(\W{0,1})(456)(\W{0,1})(78)$/; |
+ var matches = numberFormat.match(regex) || ['','','.','',',']; |
dpapad
2011/12/12 23:58:06
The fix has 2 parts.
1) Changing the regex to all
Lei Zhang
2011/12/13 00:16:02
Isn't this reversed? ',' for thousands and '.' for
dpapad1
2011/12/13 01:01:19
Well, I am not sure what the fallback should be. I
dpapad1
2011/12/13 01:11:32
Done.
|
MarginSettings.thousandsPoint = matches[2]; |
MarginSettings.decimalPoint = matches[4]; |
MarginSettings.useMetricSystem = measurementSystem == 0; |