Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function zmenFormat(cislo){
- if (cislo == "-") return "-";
- if (!isNaN(cislo)) {
- var moje_cislo = cislo.replaceAll(" ","");
- var index = (moje_cislo.indexOf(".")==-1) ? (moje_cislo.length-1) : (moje_cislo.indexOf(".")-1);
- var pocitadlo = 1;
- while (index>0){
- if (pocitadlo%3==0){
- moje_cislo = moje_cislo.substr(0,index)+" "+moje_cislo.substr(index);
- }
- pocitadlo += 1;
- index -= 1;
- }
- return moje_cislo;
- }
- return cislo;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement