1

I have to concat a numeric value with currency code, but the currency get append after the numeric value like د.إ111 but I want the currency to be appended in the front and then the price value

let price = 111;
let currency = "د.إ";
let str3 =  currency.concat(price)
console.log(str3)

Daniel A. White
  • 187,200
  • 47
  • 362
  • 445
Dev Node
  • 19
  • 2

1 Answers1

0

You can do it with the RTL code, the price will be on the RH and following by the currency name on the LH:

let price    = 111;
let currency = "دإ";
let RTL      = "\u200F";
console.log(RTL +price + " " + currency);

// another method
let str3 = `${RTL}${price} ${currency}`;
console.log(str3);
Mohsen Alyafei
  • 4,765
  • 3
  • 30
  • 42