Changeset 15711

Show
Ignore:
Timestamp:
11/15/08 19:34:22 (8 weeks ago)
Author:
peller
Message:

Normalize whitespace/nbsp handling for currency. Thanks, rauldiaz, for flagging this. Fixes #8036

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/1.2/dojo/number.js

    r14590 r15711  
    334334        if(isCurrency){ 
    335335                // substitute the currency symbol for the placeholder in the pattern 
    336                 re = re.replace(/(\s*)(\u00a4{1,3})(\s*)/g, function(match, before, target, after){ 
     336                re = re.replace(/([\s\xa0]*)(\u00a4{1,3})([\s\xa0]*)/g, function(match, before, target, after){ 
    337337                        var prop = ["symbol", "currency", "displayName"][target.length-1]; 
    338338                        var symbol = dojo.regexp.escapeString(options[prop] || options.currency || ""); 
    339                         before = before ? "\\s" : ""; 
    340                         after = after ? "\\s" : ""; 
     339                        before = before ? "[\\s\\xa0]" : ""; 
     340                        after = after ? "[\\s\\xa0]" : ""; 
    341341                        if(!options.strict){ 
    342342                                if(before){before += "*";}