Forum: Ruby-dev [ruby-trunk - Bug #8916][Open] rb sprintf への精度指定が正しく機能していない

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
tadf (tadayoshi funaba) (Guest)
on 2013-09-16 00:01
(Received via mailing list)
Issue #8916 has been reported by tadf (tadayoshi funaba).

Bug #8916: rb_sprintf への精度指定が正しく機能していない

Author: tadf (tadayoshi funaba)
Status: Open
Priority: Low
Target version:
ruby -v: ruby 2.1.0dev (2013-09-16 trunk 42949) [i686-linux]
Backport: 1.9.3: UNKNOWN, 2.0.0: UNKNOWN

rb_sprintf への精度指定が正しく機能していない。

  rb_sprintf("%.04d", -2) /* => "-002" */

  format('%.4d', -2) #=> "-0002"
This topic is locked and can not be replied to.