imports/vx/both/code/util.js
/**
     * Format a card number.
     *
     * @param {string} creditCardNumber Card number to format.
     * @returns {string} Number formatted as card number.
     */
Format a card number.
@param {string} creditCardNumber Card number to format.
@returns {string} Number formatted as card number.
Format a card number . @param { string } creditCardNumber Card number to format . @returns { string } Number formatted as card number .
formatCreditCardNumber(creditCardNumber) {
        if (!creditCardNumber) {
            return
        }
        try {
            return creditCardNumber.substring(0, 4) + " " +
                creditCardNumber.substring(4, 8) + " " +
                creditCardNumber.substring(8, 12) + " " +
                creditCardNumber.substring(12, 16)
        }
        catch (error) {
            OLog.error("util.js formatCreditCardNumber error=" + error)
            return
        }
    }
formatCreditCardNumber ( creditCardNumber ) { if ( ! creditCardNumber ) { return } try { return creditCardNumber . substring ( 0 , 4 ) + " " + creditCardNumber . substring ( 4 , 8 ) + " " + creditCardNumber . substring ( 8 , 12 ) + " " + creditCardNumber . substring ( 12 , 16 ) } catch ( error ) { OLog . error ( "util.js formatCreditCardNumber error=" + error ) return } }
Format a card number.
Format a card number .