We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
3.8.4
windows 11
Long float dots had a bad format expect to have a float format ,not a scientific notation format.
No response
This method will solve the problem
public static getFloatString (strNum: number): string { let str = String(strNum); if (str.indexOf("e") !== -1) { let strArr = str.split("e"); let factor = strArr[0].split("."); let powNum = parseInt(strArr[1]); if (powNum < 0) { return "0" + "." + "0".repeat(-powNum - factor[0].length) + factor[0] + (factor.length === 2 ? factor[1] : ""); } else { if (factor.length === 2) { let dotNum = powNum - factor[1].length; if (dotNum < 0) { let spl = factor[1].slice(0, -dotNum); return factor[0] + spl[0] + "." + spl[1]; } else { return factor[0] + factor[1] + "0".repeat(dotNum - factor[0].length); } } else { return factor[0] + "0".repeat(powNum - factor[0].length); } } } else { return str; } }
The text was updated successfully, but these errors were encountered:
@yufengctbu check the design doc or issue to see the purpose of why we're doing this.
Sorry, something went wrong.
yufengctbu
No branches or pull requests
Cocos Creator version
3.8.4
System information
windows 11
Issue description
Long float dots had a bad format
expect to have a float format ,not a scientific notation format.
Relevant error log output
No response
Steps to reproduce
This method will solve the problem
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: