I would like to add suffix to the number with % instead of the current ₹ symbol in the front and also remove the .00 decimal points too. So the result shows as 9% instead of ₹9.00
I am not sure if one could modify this script to suit my needs. Here's my code:
$('.percent').each(function() {
var monetary_value = $(this).text();
if ($.isNumeric(monetary_value) && (monetary_value < 100 || monetary_value.length == 2)) {
var i = new Intl.NumberFormat('en-IN', {
style: 'currency',
currency: 'INR'
}).format(monetary_value);
}
$(this).text(i);
});
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<div class="percent">9</div>
Demo JSFiddle: http://jsfiddle.net/4p98aw6u/