When you pass price value phtml to js , you need to display price with currency from js.
Use ‘Magento_Catalog/js/price-utils’ priceUtils Js object in your custom javascript file to set currency to price.
Then add getFormattedPrice() function in your file to display currency symbol with price from javascript.
define([
'ko',
'Magento_Catalog/js/price-utils'
], function (
ko,
priceUtils
) {
'use strict';
return {
/**
* Formats the price with currency format
*
* @param {number}
* @return {string}
*/
getFormattedPrice: function (price) {
var priceFormat = {
decimalSymbol: '.',
groupLength: 3,
groupSymbol: ",",
integerRequired: false,
pattern: "₹%s",
precision: 2,
requiredPrecision: 2
};
return priceUtils.formatPrice(price, priceFormat);
}
}
});

