Digits less than 5 need not to be changed as changing them will lead to a larger number
if ( str [ i ] . charCodeAt ( ) >= ( ' ' ) . charCodeAt ( ) ) { str [ i ] = String . fromCharCode ( ( ( ' ' ) . charCodeAt ( ) - ( str [ i ] ) . charCodeAt ( ) ) + ( ' ' ) . charCodeAt ( ) ) ; } }