feat: add formatting rupiah in payback
This commit is contained in:
parent
69efeca588
commit
d77054cbc8
|
@ -1,5 +1,5 @@
|
|||
import React, {useContext, useState} from "react";
|
||||
import {Form, Input, message, Modal, Upload,} from "antd";
|
||||
import {Form, InputNumber, message, Modal, Upload,} from "antd";
|
||||
import {useStore} from "../../utils/useStore";
|
||||
import {LoadingOutlined, PlusOutlined} from "@ant-design/icons";
|
||||
import {ModalLoaderContext} from "../../utils/modal";
|
||||
|
@ -141,13 +141,11 @@ export const PaybackModal = ({initialData}) => {
|
|||
|
||||
{image === "" ? uploadButton : null}
|
||||
</Upload>
|
||||
<h5
|
||||
style={{
|
||||
<h5 style={{
|
||||
marginTop: 12,
|
||||
color: "rgba(0, 0, 0, 0.45)",
|
||||
}}
|
||||
>
|
||||
Max size of file 2 mb
|
||||
}}>
|
||||
Max size of file 2 MB
|
||||
</h5>
|
||||
</div>
|
||||
</Form.Item>
|
||||
|
@ -156,7 +154,11 @@ export const PaybackModal = ({initialData}) => {
|
|||
label="amount"
|
||||
rules={[{required: true, message: "Please input Amount!"}]}
|
||||
>
|
||||
<Input/>
|
||||
<InputNumber
|
||||
style={{width: "100%"}}
|
||||
formatter={value => `Rp. ${value}`.replace(/\B(?=(\d{3})+(?!\d))/g, ',')}
|
||||
parser={value => value.replace(/\Rp.\s?|(,*)/g, '')}
|
||||
/>
|
||||
</Form.Item>
|
||||
</Form>
|
||||
</Modal>
|
||||
|
|
Loading…
Reference in New Issue
Block a user