@@ -10,6 +10,7 @@ import { __experimentalCreateInterpolateElement as createInterpolateElement } fr
10
10
* Internal dependencies
11
11
*/
12
12
import { formatCurrency } from 'utils/currency' ;
13
+ import { formatFee } from 'utils/fees' ;
13
14
14
15
export const getCurrentFee = ( accountFees ) => {
15
16
return accountFees . discount . length
@@ -23,8 +24,8 @@ export const formatAccountFeesDescription = ( accountFees ) => {
23
24
24
25
let feeDescription = sprintf (
25
26
/* translators: %1: Percentage part of the fee. %2: Fixed part of the fee */
26
- __ ( '%1$.1f %% + %2$s per transaction' , 'woocommerce-payments' ) ,
27
- baseFee . percentage_rate * 100 ,
27
+ __ ( '%1$f %% + %2$s per transaction' , 'woocommerce-payments' ) ,
28
+ formatFee ( baseFee . percentage_rate ) ,
28
29
formatCurrency ( baseFee . fixed_rate , baseFee . currency )
29
30
) ;
30
31
@@ -45,21 +46,21 @@ export const formatAccountFeesDescription = ( accountFees ) => {
45
46
let descriptionString = sprintf (
46
47
/* translators: %1 Base fee (that don't apply to this account at this moment), %2 and %3: Current fee (e.g: 2.9% + $.30) */
47
48
__ (
48
- '<s>%1$s</s> %2$.1f %% + %3$s per transaction' ,
49
+ '<s>%1$s</s> %2$f %% + %3$s per transaction' ,
49
50
'woocommerce-payments'
50
51
) ,
51
52
feeDescription ,
52
- percentage * 100 ,
53
+ formatFee ( percentage ) ,
53
54
formatCurrency ( fixed , baseFee . currency )
54
55
) ;
55
56
56
57
if ( currentFee . discount ) {
57
58
descriptionString +=
58
59
' ' +
59
60
sprintf (
60
- /* translators: %d percentage discount to apply */
61
- __ ( '(%1$d %% discount)' , 'woocommerce-payments' ) ,
62
- currentFee . discount * 100
61
+ /* translators: %f percentage discount to apply */
62
+ __ ( '(%f %% discount)' , 'woocommerce-payments' ) ,
63
+ formatFee ( currentFee . discount )
63
64
) ;
64
65
}
65
66
0 commit comments