🐛 Fixing percentage
This commit is contained in:
parent
117636eb4f
commit
5ffdca6323
@ -140,7 +140,10 @@ export default class UserFolder extends React.Component<IProps, IState> {
|
|||||||
if (!this.props.customer.documents) return 0;
|
if (!this.props.customer.documents) return 0;
|
||||||
const totalDocuments: number = this.props.customer.documents.length;
|
const totalDocuments: number = this.props.customer.documents.length;
|
||||||
const numberDocumentsAsked: number = this.getDocumentsByStatus(EDocumentStatus.ASKED)?.length || 0;
|
const numberDocumentsAsked: number = this.getDocumentsByStatus(EDocumentStatus.ASKED)?.length || 0;
|
||||||
return Math.round(((totalDocuments - numberDocumentsAsked) / totalDocuments) * 100);
|
|
||||||
|
const percentage = Math.round(((totalDocuments - numberDocumentsAsked) / totalDocuments) * 100);
|
||||||
|
if(!percentage) return 0;
|
||||||
|
return percentage;
|
||||||
}
|
}
|
||||||
|
|
||||||
private getDocumentsByStatus(status: string): Document[] | null {
|
private getDocumentsByStatus(status: string): Document[] | null {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user