Sha256: a20152c64627f64d373b6186300147fc9c8e05e3c03884c6f48a5424822420a9
Contents?: true
Size: 997 Bytes
Versions: 1
Compression:
Stored size: 997 Bytes
Contents
module Split module DashboardHelpers def url(*path_parts) [ path_prefix, path_parts ].join("/").squeeze('/') end def path_prefix request.env['SCRIPT_NAME'] end def number_to_percentage(number, precision = 2) round(number * 100) end def round(number, precision = 2) BigDecimal.new(number.to_s).round(precision).to_f end def confidence_level(z_score) return z_score if z_score.is_a? String z = round(z_score.to_s.to_f, 3) if z > 0.0 if z < 1.96 'no confidence' elsif z < 2.57 '95% confidence' elsif z < 3.29 '99% confidence' else '99.9% confidence' end elsif z < 0.0 if z > -1.96 'no confidence' elsif z > -2.57 '95% confidence' elsif z > -3.29 '99% confidence' else '99.9% confidence' end else "No Change" end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
split-0.4.1 | lib/split/dashboard/helpers.rb |