Skip to content

Commit

Permalink
Improve display of prices over 1M
Browse files Browse the repository at this point in the history
  • Loading branch information
olliebennett committed Jun 20, 2024
1 parent 7855d1a commit 6b10d3c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion app/models/home.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ def price_display
return 'UNKNOWN PRICE' if price.zero?

# Assume monthly rental amount if < 10k
if price > 10_000
if price > 1_000_000
#{price / 1_000_000.0}m"
elsif price > 10_000
#{price / 1000}k"
else
#{price} pcm"
Expand Down

0 comments on commit 6b10d3c

Please sign in to comment.