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

C4e88907313843cf07f6d85ba8162120?d=identicon&s=25 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 への精度指定が正しく機能していない
https://bugs.ruby-lang.org/issues/8916

Author: tadf (tadayoshi funaba)
Status: Open
Priority: Low
Assignee:
Category:
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.