Project

General

Profile

Actions

Bug #4078

closed

format() の %a 指定で 不要な小数点が印字されることがある

Added by tadf (tadayoshi funaba) over 13 years ago. Updated almost 13 years ago.

Status:
Closed
Assignee:
-
Target version:
-
ruby -v:
ruby 1.9.3dev (2010-11-21 trunk 29845) [i686-linux]
Backport:
[ruby-dev:42615]

Description

=begin
format() の %a 指定で 不要な小数点が印字されることがある。

format('%.0a', 1) #=> "0x1.p+0"

ほかの %f や %e ではそうではなく、

format('%.0f', 1) #=> "1"
format('%.0e', 1) #=> "1e+00"

フラグがあればこれでいいと思います。

format('%#.0a', 1) #=> "0x1.p+0"
format('%#.0f', 1) #=> "1."
format('%#.0e', 1) #=> "1.e+00"
=end

Actions #1

Updated by naruse (Yui NARUSE) over 13 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
This issue was solved with changeset r29873.
tadayoshi, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.

=end

Actions

Also available in: Atom PDF

Like0
Like0