Bug 961271 - Part 1: write BCD chars. r=vicamo

This commit is contained in:
Yoshi Huang 2014-01-27 14:24:57 +08:00
parent c0bd6944ff
commit f8a9196aaa

View File

@ -9665,6 +9665,13 @@ let ICCPDUHelper = {
writeNumberWithLength: function(number) {
if (number) {
let numStart = number[0] == "+" ? 1 : 0;
number = number.substring(0, numStart) +
number.substring(numStart)
.replace(/[^0-9*#,]/g, "")
.replace(/\*/g, "a")
.replace(/\#/g, "b")
.replace(/\,/g, "c");
let numDigits = number.length - numStart;
if (numDigits > ADN_MAX_NUMBER_DIGITS) {
number = number.substring(0, ADN_MAX_NUMBER_DIGITS + numStart);