You can try this
function ConvertDigits(input, source, target) { var systems = { arabic: 48, english: 48, tamil: 3046, kannada: 3302, telugu: 3174, hindi: 2406, malayalam: 3430, oriya: 2918, gurmukhi: 2662, nagari: 2534, gujarati: 2790, }, output = [], offset = 0, zero = 0, nine = 0, char = 0; source = source.toLowerCase(); target = target.toLowerCase(); if (!(source in systems && target in systems) || input == null || typeof input == "undefined" || typeof input == "object") { return input; } input = input.toString(); offset = systems[target] - systems[source]; zero = systems[source]; nine = systems[source] + 9; for (var i = 0 ; i < input.length; i++) { var char = input.charCodeAt(i); if (char >= zero && char <= nine) { output.push(String.fromCharCode(char + offset)); } else { output.push(input[i]); } } return output.join("");
}
var res = ConvertDigits ('12345678 9', 'hindi', 'english');
I got it here. If you need a jquery thing, please try this link.
Satheesh Sep 19 '14 at 7:22 2014-09-19 07:22
source share