Skip to content

ArgumentError: invalid value for BigDecimal(): "N/A" #13

@beet

Description

@beet

Steps to reproduce:

When attempting to produce an export when a test is present without enough participants to calculate the statistical confidence, exports raise an exception attempting to convert the string "N/A" to a float.

> csv_data = Split::Export.to_csv
ArgumentError: invalid value for BigDecimal(): "N/A"
from /Users/markb/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/split-export-2.0.0/lib/split/export.rb:10:in `initialize'

Could it convert the number to an integer instead of a string to give a value of 0.0?

[5] pry(main)> BigDecimal.new("NA".to_i).round(2).to_f
=> 0.0

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions