fix undefined

This commit is contained in:
Muhammad Eko Prasetyo 2022-05-04 05:44:46 +07:00
parent aa094d665c
commit 36ec24f023

View File

@ -86,10 +86,15 @@ export default function Artifacts() {
};
const getPercent = (affix:IReliquaryAffix)=>{
if (affix.PropType.indexOf("PERCENT") !== -1 || affix.PropType.indexOf("CRITICAL") !== -1 || affix.PropType.indexOf("EFFICIENCY") !== -1 || affix.PropType.indexOf("HURT") !== -1) {
return parseFloat(String(affix.PropValue*100)).toPrecision(3) + "%";
try{
if (affix.PropType.indexOf("PERCENT") !== -1 || affix.PropType.indexOf("CRITICAL") !== -1 || affix.PropType.indexOf("EFFICIENCY") !== -1 || affix.PropType.indexOf("HURT") !== -1) {
return parseFloat(String(affix.PropValue*100)).toPrecision(3) + "%";
}
return parseInt(String(affix.PropValue));
}catch (e) {
console.log(e);
return parseInt(String(affix.PropValue));
}
return parseInt(String(affix.PropValue));
};
const handleGeneratedArtifact = () => {