File size: 415 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
import { formatCurrency } from '@automattic/number-formatters';
import { getUnformattedDomainPrice } from './get-unformatted-domain-price';

export function getDomainPrice( slug, productsList, currencyCode, stripZeros = false ) {
	let price = getUnformattedDomainPrice( slug, productsList );

	if ( typeof price === 'number' ) {
		price = formatCurrency( price, currencyCode, { stripZeros } );
	}

	return price;
}