Added a number asset to limit to a specific number of decimal cases if needed
This commit is contained in:
@@ -25,6 +25,7 @@ import Input from "@/components/Low/Input";
|
||||
import ReactDatePicker from "react-datepicker";
|
||||
import moment from "moment";
|
||||
import PaymentAssetManager from "@/components/PaymentAssetManager";
|
||||
import { toFixedNumber } from "@/utils/number";
|
||||
|
||||
export const getServerSideProps = withIronSessionSsr(({req, res}) => {
|
||||
const user = req.session.user;
|
||||
@@ -89,7 +90,7 @@ const PaymentCreator = ({onClose, reload}: {onClose: () => void; reload: () => v
|
||||
corporate: corporate?.id,
|
||||
agent: referralAgent?.id,
|
||||
agentCommission: commission,
|
||||
agentValue: (commission / 100) * price,
|
||||
agentValue: toFixedNumber((commission / 100) * price, 2),
|
||||
currency,
|
||||
value: price,
|
||||
isPaid: false,
|
||||
@@ -431,7 +432,7 @@ export default function PaymentRecord() {
|
||||
header: "Amount",
|
||||
cell: (info) => (
|
||||
<span>
|
||||
{info.getValue().toFixed(2)} {CURRENCIES.find((x) => x.currency === info.row.original.currency)?.label}
|
||||
{toFixedNumber(info.getValue(), 2)} {CURRENCIES.find((x) => x.currency === info.row.original.currency)?.label}
|
||||
</span>
|
||||
),
|
||||
}),
|
||||
@@ -453,7 +454,7 @@ export default function PaymentRecord() {
|
||||
header: "Commission Value",
|
||||
cell: (info) => (
|
||||
<span>
|
||||
{info.getValue().toFixed(2)} {CURRENCIES.find((x) => x.currency === info.row.original.currency)?.label}
|
||||
{toFixedNumber(info.getValue(), 2)} {CURRENCIES.find((x) => x.currency === info.row.original.currency)?.label}
|
||||
</span>
|
||||
),
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user