Project

General

Profile

Actions

Bug #13761

closed

incomplete format specifier

Added by ahorek (Pavel Rosický) over 6 years ago. Updated over 6 years ago.

Status:
Closed
Assignee:
-
Target version:
-
[ruby-core:82118]

Description

is it a bug?

'%0.0f%' % 45

expected
ruby 2.4.1 =>  '45%'

actual
ruby trunk => ArgumentError: incomplete format specifier

workaround

'%0.0f%s' % [45, '%']
=> '45%'
ruby -v
ruby 2.5.0dev (2017-07-21 trunk 59380) [x86_64-linux]

Updated by matz (Yukihiro Matsumoto) over 6 years ago

  • Status changed from Open to Closed

No, it's not a bug. Use "%0.0f%%" (double %) instead.

Matz

Actions #2

Updated by usa (Usaku NAKAMURA) over 6 years ago

  • Backport changed from 2.2: UNKNOWN, 2.3: UNKNOWN, 2.4: UNKNOWN to 2.2: WONTFIX, 2.3: WONTFIX, 2.4: UNKNOWN
Actions

Also available in: Atom PDF

Like0
Like0Like0