Skip to content

Commit bdf1cb3

Browse files
committed
Fix style property on FormattedNumber
1 parent 25e55c5 commit bdf1cb3

File tree

1 file changed

+32
-5
lines changed

1 file changed

+32
-5
lines changed

src/FormattedNumber.js

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,41 @@
11
import React, { PropTypes, Text } from 'react-native';
22
import Intl from 'react-intl';
33

4-
const FormattedNumber = props => (
5-
<Intl.FormattedNumber {...props}>
6-
{localized => <Text style={props.style}>{localized}</Text>}
7-
</Intl.FormattedNumber>
8-
);
4+
const FormattedNumber = props => {
5+
const style = props.style;
6+
7+
const formatOptions = {
8+
localeMatcher: props.localeMatcher,
9+
style: props.formatStyle,
10+
currency: props.currency,
11+
currencyDisplay: props.currencyDisplay,
12+
useGrouping: props.useGrouping,
13+
minimumIntegerDigits: props.minimumIntegerDigits,
14+
minimumFractionDigits: props.minimumFractionDigits,
15+
maximumFractionDigits: props.maximumFractionDigits,
16+
minimumSignificantDigits: props.minimumSignificantDigits,
17+
maximumSignificantDigits: props.maximumSignificantDigits,
18+
};
19+
20+
return (
21+
<Intl.FormattedNumber {...formatOptions}>
22+
{localized => <Text style={style}>{localized}</Text>}
23+
</Intl.FormattedNumber>
24+
);
25+
};
926

1027
FormattedNumber.propTypes = {
1128
style: PropTypes.any,
29+
localeMatcher: PropTypes.any,
30+
formatStyle: PropTypes.any,
31+
currency: PropTypes.any,
32+
currencyDisplay: PropTypes.any,
33+
useGrouping: PropTypes.any,
34+
minimumIntegerDigits: PropTypes.any,
35+
minimumFractionDigits: PropTypes.any,
36+
maximumFractionDigits: PropTypes.any,
37+
minimumSignificantDigits: PropTypes.any,
38+
maximumSignificantDigits: PropTypes.any,
1239
};
1340

1441
export default FormattedNumber;

0 commit comments

Comments
 (0)