Symfony 1.4 setter 类型双精度

发布于 2024-09-04 00:07:05 字数 438 浏览 5 评论 0原文

我想保存一个小数点后 14 位的数字,但 symfony 只保存 6 位。我怎样才能控制这个:

$loc->setSinRadLon(0.73946213661883);

在架构中,列看起来像:

sin_rad_lon: { type: double(), scale: 14, notnull: true }

数据库设置是:

sin_rad_lon     double(18,14)

在数据库中,列值是:0.73946200000000强>(8号被削减)。

(我刚刚尝试了 ini_set(" precision", "14") ,但它并不能解决所有问题。)

感谢您的帮助。

I want to save a number with 14 decimal places, but symfony only saves 6. How can I control this:

$loc->setSinRadLon(0.73946213661883);

In the schema the column looks like:

sin_rad_lon: { type: double(), scale: 14, notnull: true }

The DB stetting is:

sin_rad_lon     double(18,14)

In the DB the column value is: 0.73946200000000 (8 numbers are cut).

(I just tried ini_set("precision", "14") but it does not solve all problems.)

Thx for your help.

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

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

发布评论

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

评论(1

一萌ing 2024-09-11 00:07:05

尝试在您的架构中更改数据类型的“长度”,例如类型:double(X),比例:Y

try to change at your schema the "length" of the datatype for example type: double(X), scale: Y

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