components_node/functions-generic.js
/**
     * Data treatment for writing value.
     * @static
     * @param {string} valueData 
     * @param {int} valueType 1 - general number | 2 - system currency | 3 - decimal | 4 - system currency (decimal)
     * @param {*} specialInstructions 
     * @returns {int | double | string}
     * @example
     * SyncSystemNS.FunctionsGeneric.valueMaskWrite(variableNameOrText, 2)
     */
Data treatment for writing value.
Data treatment for writing value .
static valueMaskWrite(valueData, valueType = 2, specialInstructions = null)
    {
        let strReturn = valueData;
        if(strReturn !== null || typeof(strReturn) !== "undefined")
        {
            if(valueType == 2)
            {
                strReturn = strReturn.replace(/\,/g, "");
                strReturn = strReturn.replace(/\./g, "");
            }
            if(valueType == 3)
            {
                strReturn = strReturn.replace(/\,/g, "");
            }
             (decimals)
            if(valueType == 4)
            {
                if(gSystemConfig.configSystemCurrency == "R$")
                {
                    strReturn = strReturn.replace(/\./g, "");
                    strReturn = strReturn.replace(/\,/g, ".");
                }
                if(gSystemConfig.configSystemCurrency == "$")
                {
                    strReturn = strReturn.replace(/\,/g, "");
                }                
            }
        }
        return strReturn;
    }
static valueMaskWrite ( valueData , valueType = 2 , specialInstructions = null ) { let strReturn = valueData ; if ( strReturn !== null || typeof ( strReturn ) !== "undefined" ) { if ( valueType == 2 ) { strReturn = strReturn . replace ( / \, / g , "" ) ; strReturn = strReturn . replace ( / \. / g , "" ) ; } if ( valueType == 3 ) { strReturn = strReturn . replace ( / \, / g , "" ) ; } if ( valueType == 4 ) { if ( gSystemConfig . configSystemCurrency == "R$" ) { strReturn = strReturn . replace ( / \. / g , "" ) ; strReturn = strReturn . replace ( / \, / g , "." ) ; } if ( gSystemConfig . configSystemCurrency == "$" ) { strReturn = strReturn . replace ( / \, / g , "" ) ; } } } return strReturn ; }
Data treatment for writing value.
Data treatment for writing value .
//valueType: 1 - general number | 2 - system currency | 3 - decimal (máximum: 34 digits) | 4 - system currency (decimal) //Variables. //---------------------- //---------------------- //Logic. //system currency //strReturn = strReturn.replace(",", ""); //decimal //system currency (decimals) //R$ - Real. //$ - Dollar.