example param { any } val param { number } totalLeng param { String } symbol export function paddingLeft ( val = '' , totalLeng = 0 , symbol = '0' ) { let StrLengt = val . toString ( ) . length ; let result = [ val . toString ( ) ] ; if ( StrLengt < totalLeng ) { let num = totalLeng - StrLengt ; for ( let i = 0 ; i < num ; i ++ ) { result . unshift ( symbol ) ; } } return result . toString ( ) . replace ( /,/g , '' ) ; } example param { any } val param { number } totalLeng param { String } symbol export function paddingRight ( val = '' , totalLeng = 0 , symbol = '0' ) { let StrLengt = val . toString ( ) . length ; let result = [ val . toString ( ) ] ; if ( StrLengt < totalLeng ) { let num = totalLeng - StrLengt ; for ( let i = 0 ; i < num ; i ++ ) { result . push ( symbol ) ; } } return result . toString ( ) . replace ( /,/g , '' ) ; }