I would like to bold some character in a javascript confirm popup. As you can't use html/css there, and extending a bit the solution to underline with the dedicated unicode character, I thought I might simply replace each digit with its bolded unicode counterpart, and as they are five digit long (ranging from 1D7CE to , 1D7D7), I came with the following code:
function bold(number) {
return number.
replace(/0/, String.fromCharCode(0x1D7CE)).
replace(/1/, String.fromCharCode(0x1D7CF)).
replace(/2/, String.fromCharCode(0x1D7D0)).
replace(/3/, String.fromCharCode(0x1D7D1)).
replace(/4/, String.fromCharCode(0x1D7D2)).
replace(/5/, String.fromCharCode(0x1D7D3)).
replace(/6/, String.fromCharCode(0x1D7D4)).
replace(/7/, String.fromCharCode(0x1D7D5)).
replace(/8/, String.fromCharCode(0x1D7D6)).
replace(/9/, String.fromCharCode(0x1D7D7));
}
But I must misunderstand something, as for example 1
is replaced with ퟏ
(D7CE).
What might be a working solution?