Issue #8916 has been updated by usa (Usaku NAKAMURA).

Backport changed from 2.2: REQUIRED, 2.3: REQUIRED, 2.4: REQUIRED to 2.2: REQUIRED, 2.3: DONE, 2.4: REQUIRED

ruby_2_3 r59233 merged revision(s) 58210.

----------------------------------------
Bug #8916: rb_sprintf 吾膕上墾fhttps://bugs.ruby-lang.org/issues/8916#change-65590

* Author: tadf (tadayoshi funaba)
* Status: Closed
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.1.0dev (2013-09-16 trunk 42949) [i686-linux]
* Backport: 2.2: REQUIRED, 2.3: DONE, 2.4: REQUIRED
----------------------------------------
`rb_sprintf` への精度指定が正しく機能していない。

```c
rb_sprintf("%.04d", -2) /* => "-002" */
```
```ruby
format('%.4d', -2) #=> "-0002"
```



-- 
https://bugs.ruby-lang.org/