O_Number函数如果数字为Morethan 15数字

发布于 2025-02-13 06:33:12 字数 157 浏览 0 评论 0原文

select to_number('5131427328503192','9999999999999999') 
from dual

输出: 5.13142732850319E15

我如何使输出原样数字

select to_number('5131427328503192','9999999999999999') 
from dual

output: 5.13142732850319E15

How I can make the output as-is number

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

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

发布评论

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

评论(1

剑心龙吟 2025-02-20 06:33:12

一个数字存储为二进制数据,并且使用任何特定(可读)格式的数据库中存储在数据库中。

数字的格式是您用于连接到数据库的客户端应用程序的函数。

在SQL*plus中,您可以使用:

SET NUMFORMAT 9999999999999999999990.9999999999999

在其他客户端应用程序中,您可以检查设置/首选项,以查看它们是否支持默认号码格式并更改。

但是,

如果您想要特定格式,那么最可靠的解决方案是使用to_char使用明确格式的模型将您的(未施加)编号转换为格式的字符串:

SELECT TO_CHAR(
         to_number('5131427328503192','9999999999999999'),
         'fm999999999999999990'
       )
FROM   DUAL

A number is stored as binary data and is NEVER stored in the database with any particular (human-readable) formatting.

How the number is formatted is a function of the client application that you use to connect to the database.

In SQL*Plus, you can use:

SET NUMFORMAT 9999999999999999999990.9999999999999

In other client applications you can check the settings/preferences to see if they support a default number format and change that.

However

If you want a specific format then the most reliable solution is to convert your (unformatted) number to a formatted string using TO_CHAR with an explicit format model:

SELECT TO_CHAR(
         to_number('5131427328503192','9999999999999999'),
         'fm999999999999999990'
       )
FROM   DUAL
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文