Lines 203-230
Link Here
|
203 |
var newValue = textObj.value; |
203 |
var newValue = textObj.value; |
204 |
var decAmount = ""; |
204 |
var decAmount = ""; |
205 |
var dolAmount = ""; |
205 |
var dolAmount = ""; |
206 |
var decFlag = false; |
206 |
var dolFlag = false; |
207 |
var aChar = ""; |
207 |
var aChar = ""; |
208 |
|
208 |
|
209 |
for(var i=0; i < newValue.length; i++) { |
209 |
for(var i = newValue.length; 0 < i; i--) { |
210 |
aChar = newValue.substring(i, i+1); |
210 |
aChar = newValue.substring(i-1, i); |
211 |
if (aChar >= "0" && aChar <= "9") { |
211 |
if ("0" <= aChar && aChar <= "9") { |
212 |
if(decFlag) { |
212 |
if(dolFlag) { |
213 |
decAmount = "" + decAmount + aChar; |
213 |
dolAmount = "" + aChar + dolAmount; |
214 |
} |
214 |
} |
215 |
else { |
215 |
else { |
216 |
dolAmount = "" + dolAmount + aChar; |
216 |
decAmount = "" + aChar + decAmount; |
217 |
} |
217 |
} |
218 |
} |
218 |
} |
219 |
if (aChar == ".") { |
219 |
if (aChar == "." || aChar == ",") { |
220 |
if (decFlag) { |
220 |
dolFlag = true; |
221 |
dolAmount = ""; |
|
|
222 |
break; |
223 |
} |
224 |
decFlag = true; |
225 |
} |
221 |
} |
226 |
} |
222 |
} |
227 |
|
223 |
|
|
|
224 |
if (!dolFlag) { |
225 |
dolAmount = decAmount; |
226 |
decAmount = ""; |
227 |
} |
228 |
|
228 |
if (dolAmount == "") { |
229 |
if (dolAmount == "") { |
229 |
dolAmount = "0"; |
230 |
dolAmount = "0"; |
230 |
} |
231 |
} |
231 |
- |
|
|