HEX
Server: Apache
System: Linux webd003.cluster128.gra.hosting.ovh.net 6.18.42-ovh-vps-grsec-zfs+ #1 SMP PREEMPT_DYNAMIC Wed Aug 5 15:59:48 CEST 2026 x86_64
User: slyfwmm (169339)
PHP: 8.1.34
Disabled: _dyuweyrj4,_dyuweyrj4r,dl
Upload Files
File: /home/slyfwmm/pianob/wp-content/plugins/hbook/admin-pages/js/hb-price-utils.js
function hb_is_valid_price( price ) {
	if ( price != parseFloat( price ) ) {
		alert( hb_text.invalid_amount );
		return false;
	} else {
		return true;
	}
}

function hb_format_price( price ) {
	var negative_symbol = '';
	if ( ( price < 0 ) && ( hb_currency_pos == 'before' ) ) {
		negative_symbol = '-';
		price *= -1;
	}
	if ( hb_price_precision == 'no_decimals' ) {
		price = parseFloat( price ).toFixed( 0 );
	} else {
		price = parseFloat( price ).toFixed( 2 );
	}
	price = price.replace( /\B(?=(\d{3})+(?!\d))/g, ',' );
	if ( hb_currency_pos == 'before' ) {
		price = negative_symbol + hb_currency_symbol + price;
	} else {
		price = price + hb_currency_symbol;
	}
	return price;
}