Bug #2266
Incompatible use of round method in earlier Ruby versions found in OneFlow component
Status: | Closed | Start date: | 08/13/2013 | |
---|---|---|---|---|
Priority: | Normal | Due date: | ||
Assignee: | Jaime Melis | % Done: | 100% | |
Category: | OneFlow | |||
Target version: | Release 4.4 | |||
Resolution: | fixed | Pull request: | ||
Affected Versions: | OpenNebula 4.2 |
Description
The following statement is not valid Ruby 1.8.7:
src/flow/lib/grammar.rb:934: val = (total / n_nodes).round(2)
Since round doesn't accept arguments for Ruby < 1.9.
Associated revisions
Bug #2266: Incompatible use of round method in earlier Ruby versions found in OneFlow component
Bug #2266: Incompatible use of round method in earlier Ruby versions found in OneFlow component
(cherry picked from commit ad21698a3f24362d1705a90b9498b273ad265306)
History
#1 Updated by Javi Fontan almost 8 years ago
I'd better use sprintf to format instead of round:
val=sprintf("%.2f", total / n_nodes)
#2 Updated by Ruben S. Montero almost 8 years ago
- Status changed from Pending to New
#3 Updated by Tino Vázquez almost 8 years ago
- Status changed from New to Closed
- Assignee set to Jaime Melis
- % Done changed from 0 to 100
- Resolution set to fixed
changed round to use no arguments for early ruby versions compatibility