@@ -19,6 +19,7 @@ import * as IOUUtils from '../libs/IOUUtils';
19
19
import MenuItemWithTopDescription from './MenuItemWithTopDescription' ;
20
20
import Navigation from '../libs/Navigation/Navigation' ;
21
21
import optionPropTypes from './optionPropTypes' ;
22
+ import * as CurrencyUtils from '../libs/CurrencyUtils' ;
22
23
23
24
const propTypes = {
24
25
/** Callback to inform parent modal of success */
@@ -31,7 +32,7 @@ const propTypes = {
31
32
hasMultipleParticipants : PropTypes . bool . isRequired ,
32
33
33
34
/** IOU amount */
34
- iouAmount : PropTypes . string . isRequired ,
35
+ iouAmount : PropTypes . number . isRequired ,
35
36
36
37
/** IOU type */
37
38
iouType : PropTypes . string ,
@@ -104,12 +105,10 @@ class MoneyRequestConfirmationList extends Component {
104
105
*/
105
106
getSplitOrRequestOptions ( ) {
106
107
return [ {
107
- text : this . props . translate ( this . props . hasMultipleParticipants ? 'iou.split' : 'iou.request' , {
108
- amount : this . props . numberFormat (
109
- this . props . iouAmount ,
110
- { style : 'currency' , currency : this . props . iou . selectedCurrencyCode } ,
111
- ) ,
112
- } ) ,
108
+ text : this . props . translate (
109
+ this . props . hasMultipleParticipants ? 'iou.split' : 'iou.request' ,
110
+ { amount : CurrencyUtils . convertToDisplayString ( this . props . iouAmount , this . props . iou . selectedCurrencyCode ) } ,
111
+ ) ,
113
112
value : this . props . hasMultipleParticipants ? CONST . IOU . MONEY_REQUEST_TYPE . SPLIT : CONST . IOU . MONEY_REQUEST_TYPE . REQUEST ,
114
113
} ] ;
115
114
}
@@ -136,14 +135,10 @@ class MoneyRequestConfirmationList extends Component {
136
135
* @returns {Array }
137
136
*/
138
137
getParticipantsWithAmount ( participants ) {
139
- const iouAmount = IOUUtils . calculateAmount ( participants , this . props . iouAmount , this . props . iou . selectedCurrencyCode ) ;
140
-
138
+ const iouAmount = IOUUtils . calculateAmount ( participants , this . props . iouAmount ) ;
141
139
return OptionsListUtils . getIOUConfirmationOptionsFromParticipants (
142
140
participants ,
143
- this . props . numberFormat ( iouAmount / 100 , {
144
- style : 'currency' ,
145
- currency : this . props . iou . selectedCurrencyCode ,
146
- } ) ,
141
+ CurrencyUtils . convertToDisplayString ( iouAmount , this . props . iou . selectedCurrencyCode ) ,
147
142
) ;
148
143
}
149
144
@@ -172,13 +167,10 @@ class MoneyRequestConfirmationList extends Component {
172
167
const formattedUnselectedParticipants = this . getParticipantsWithoutAmount ( unselectedParticipants ) ;
173
168
const formattedParticipants = _ . union ( formattedSelectedParticipants , formattedUnselectedParticipants ) ;
174
169
175
- const myIOUAmount = IOUUtils . calculateAmount ( selectedParticipants , this . props . iouAmount , this . props . iou . selectedCurrencyCode , true ) ;
170
+ const myIOUAmount = IOUUtils . calculateAmount ( selectedParticipants , this . props . iouAmount , true ) ;
176
171
const formattedMyPersonalDetails = OptionsListUtils . getIOUConfirmationOptionsFromMyPersonalDetail (
177
172
this . props . currentUserPersonalDetails ,
178
- this . props . numberFormat ( myIOUAmount / 100 , {
179
- style : 'currency' ,
180
- currency : this . props . iou . selectedCurrencyCode ,
181
- } ) ,
173
+ CurrencyUtils . convertToDisplayString ( myIOUAmount , this . props . iou . selectedCurrencyCode ) ,
182
174
) ;
183
175
184
176
sections . push ( {
@@ -270,18 +262,14 @@ class MoneyRequestConfirmationList extends Component {
270
262
const shouldDisableButton = selectedParticipants . length === 0 ;
271
263
const recipient = this . state . participants [ 0 ] ;
272
264
const canModifyParticipants = this . props . canModifyParticipants && this . props . hasMultipleParticipants ;
273
- const formattedAmount = this . props . numberFormat ( this . props . iouAmount , {
274
- style : 'currency' ,
275
- currency : this . props . iou . selectedCurrencyCode ,
276
- } ) ;
265
+ const formattedAmount = CurrencyUtils . convertToDisplayString ( this . props . iouAmount , this . props . iou . selectedCurrencyCode ) ;
277
266
278
267
return (
279
268
< OptionsSelector
280
269
sections = { this . getSections ( ) }
281
270
value = ""
282
271
onSelectRow = { canModifyParticipants ? this . toggleOption : undefined }
283
272
onConfirmSelection = { this . confirm }
284
- onChangeText = { this . props . onUpdateComment }
285
273
selectedOptions = { this . getSelectedOptions ( ) }
286
274
canSelectMultipleOptions = { canModifyParticipants }
287
275
disableArrowKeysActions = { ! canModifyParticipants }
0 commit comments