四舍五入小数

发布于 2025-02-06 22:53:18 字数 173 浏览 3 评论 0原文

我已经在R中提出了概率(等于1.7715E-06),我希望能够将其查看至10个小数点。有人知道如何将其转换为10个小数点吗?我已经尝试使用圆()和INDICE()功能,但它们没有用。

我使用以下答案(1.7715E-06)得到:

dbinom(11, 11, 0.3)

I have worked out a probability in r (equal to 1.7715e-06) and I would like to be able to view it to 10 decimal points. Does anybody know how to convert this to 10 decimal points? I've tried using the round() and signific() functions but they aren't useful.

I got this answer (1.7715e-06) using:

dbinom(11, 11, 0.3)

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

自此以后,行同陌路 2025-02-13 22:53:18

一个可能的解决方案:

format(round(dbinom(11, 11, 0.3), 10), scientific = F)

#> [1] "0.0000017715"

A possible solution:

format(round(dbinom(11, 11, 0.3), 10), scientific = F)

#> [1] "0.0000017715"
┾廆蒐ゝ 2025-02-13 22:53:18

您也可以这样做

options("scipen"=999)

.3^11
[1] 0.00000177147

round(.3^11,10)
[1] 0.0000017715

dbinom(11,11,.3)
[1] 0.00000177147

round(dbinom(11,11,.3),10)
[1] 0.0000017715

You can also do this:

options("scipen"=999)

Then:

.3^11
[1] 0.00000177147

or

round(.3^11,10)
[1] 0.0000017715

or

dbinom(11,11,.3)
[1] 0.00000177147

or

round(dbinom(11,11,.3),10)
[1] 0.0000017715
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文