Changeset 22289

Show
Ignore:
Timestamp:
10/28/08 23:49:59 (5 years ago)
Author:
fujidig
Message:

strf "%.010d" など、精度の先頭に 0 を指定していると 8 進数と認識されてしまうのを修正。( parseInt の罠)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • lang/javascript/hsp-on-js/trunk/src/formatter.js

    r22288 r22289  
    1919                                case '6': case '7': case '8': case '9': 
    2020                                        var matched = str.slice(pos).match(/^\d+/)[0]; 
    21                                         width = parseInt(matched); 
     21                                        width = + matched; 
    2222                                        pos += matched.length; 
    2323                                        continue; 
     
    2626                                        var matched = str.slice(pos).match(/^\d*/)[0]; 
    2727                                        pos += matched.length; 
    28                                         prec = matched.length > 0 ? parseInt(matched) : 0; 
     28                                        prec = matched.length > 0 ? + matched : 0; 
    2929                                        continue; 
    3030                                default: