Skip to content

Commit

Permalink
btc_human returns nil on nil amount
Browse files Browse the repository at this point in the history
  • Loading branch information
sigmike committed Feb 15, 2014
1 parent e9bd900 commit 632fd3b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion app/helpers/application_helper.rb
@@ -1,5 +1,6 @@
module ApplicationHelper
def btc_human amount, options = {}
return nil unless amount
nobr = options.has_key?(:nobr) ? options[:nobr] : true
currency = options[:currency] || false
btc = "%.8f Ᵽ" % to_btc(amount)
Expand All @@ -9,6 +10,6 @@ def btc_human amount, options = {}
end

def to_btc satoshies
satoshies.to_d / PeercoinBalanceUpdater::COIN
satoshies.to_d / PeercoinBalanceUpdater::COIN if satoshies
end
end

0 comments on commit 632fd3b

Please sign in to comment.