将包含科学记数法数字的字符串转换为数字

发布于 2025-01-16 01:51:11 字数 282 浏览 0 评论 0原文

我问这个问题是为了看看是否有更简单的方法来做到这一点。我有一个 API 可以为我提供 8.419379055475514E7 作为答案,但我需要这个号码没有科学记数法,所以我不想在字符串中查找 E 来检测最后一个数字,而是想知道是否有东西已经做到了这一点,我是在 JS 和 API 上进行的是来自元数据库。 谢谢!

查找 E 之前的最后一个数字,然后将其乘以 E 之后的数字。作品

I'm asking this to see if there is an easier way to do this.. I have an API that gives me 8.419379055475514E7 as an answer, but I need the number with no scientific notation, so instead of looking for the E in the string to detect the last number I want to know if there is something that already does this, I'm doing it on JS and the API is from Metabase.
Thanks!

Looking for the last number before the E, then multiply it by the number that is after the E. Works

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文