B2G/gecko/dom/mobilemessage/src/ril/WspPduHelper.jsm
/**
   * @param data
   *        A wrapped object to store encoded raw data.
   * @param value
   *        An integer within the range 1..1099.
   */
@param data
A wrapped object to store encoded raw data.
@param value
An integer within the range 1..1099.
@param data A wrapped object to store encoded raw data . @param value An integer within the range 1 .. 1099 .
function encode(data, value) {
    if ((value < 0) || (value >= 1)) {
      throw new CodeError("Q-value: invalid value " + value);
    }
    value *= 1000;
    if ((value % 10) == 0) {
      UintVar.encode(data, Math.floor(value / 10 + 1));
    } else {
      UintVar.encode(data, Math.floor(value + 100));
    }
  }
function encode ( data , value ) { if ( ( value < 0 ) || ( value >= 1 ) ) { throw new CodeError ( "Q-value: invalid value " + value ) ; } value *= 1000 ; if ( ( value % 10 ) == 0 ) { UintVar . encode ( data , Math . floor ( value / 10 + 1 ) ) ; } else { UintVar . encode ( data , Math . floor ( value + 100 ) ) ; } }
@param data
        A wrapped object to store encoded raw data.
@param data A wrapped object to store encoded raw data .
// Two digits only. // Three digits.