Commits

Kamyar Inanloo committed 96eb6b3

Fixed a minor bug.

  • Participants
  • Parent commits 2508bdd

Comments (0)

Files changed (1)

 		var raw = new String();
 		switch (typeof obj) {
 			case 'number':
-				raw = obj.toString();
+				raw = obj.toString();				
 				var numParts = raw.split('.');
 				var re = /(0*)(#*)\.?(#*)(0*)/g;
 				var parts = re.exec(format);
 				if (parts[3].length < numParts[1].length) {
 					numParts[1] = numParts[1].substr(0, parts[3].length);
 				}
-				if ((parts[4] != '') || (numParts[1] != '')) {
+				if ((parts[4] != '') || (numParts[1] != '')) {					
 					result += cultures[cultureName].decimal + String.map(numParts[1], cultures.invariant.numbers, cultures[cultureName].numbers);
 				}
 
 					return result;
 				}
 			default:
-				return String.map(obj.toString(), cultures.invariant.numbers, cultures[cultureName].numbers);
+				return String.map(obj.toString(), cultures.invariant.numbers + cultures.invariant.decimal, cultures[cultureName].numbers + cultures[cultureName].decimal);
 		}
 	}
 	else {
-		return String.map(obj.toString(), cultures.invariant.numbers, cultures[cultureName].numbers);
+		return String.map(obj.toString(), cultures.invariant.numbers + cultures.invariant.decimal, cultures[cultureName].numbers + cultures[cultureName].decimal);
 	}
 }