mirror of
https://github.com/neocities/neocities.git
synced 2025-04-25 01:32:36 +02:00
fixes for stats
This commit is contained in:
parent
1d9c71b9f8
commit
f296b86752
2 changed files with 4 additions and 4 deletions
|
@ -76,12 +76,12 @@ get '/stats/?' do
|
||||||
)
|
)
|
||||||
|
|
||||||
@stats[:poverty_threshold] = 11_945
|
@stats[:poverty_threshold] = 11_945
|
||||||
@stats[:poverty_threshold_percent] = (@stats[:monthly_revenue].to_f / (@stats[:poverty_threshold] + @stats[:expenses])) * 100
|
@stats[:poverty_threshold_percent] = (@stats[:monthly_revenue].to_f / ((@stats[:poverty_threshold]/12) + @stats[:expenses])) * 100
|
||||||
|
|
||||||
# http://en.wikipedia.org/wiki/Poverty_threshold
|
# http://en.wikipedia.org/wiki/Poverty_threshold
|
||||||
|
|
||||||
@stats[:average_developer_salary] = 93_280.00 # google "average developer salary"
|
@stats[:average_developer_salary] = 93_280.00 # google "average developer salary"
|
||||||
@stats[:percent_until_developer_salary] = (@stats[:monthly_revenue].to_f / (@stats[:average_developer_salary] + @stats[:expenses])) * 100
|
@stats[:percent_until_developer_salary] = (@stats[:monthly_revenue].to_f / ((@stats[:average_developer_salary]/12) + @stats[:expenses])) * 100
|
||||||
|
|
||||||
erb :'stats'
|
erb :'stats'
|
||||||
end
|
end
|
|
@ -106,13 +106,13 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>Neocities earnings rise above <a href="http://en.wikipedia.org/wiki/Poverty_threshold">US poverty threshold</a>:</p>
|
<p>Neocities earnings rise above <a href="http://en.wikipedia.org/wiki/Poverty_threshold">US poverty threshold</a>:</p>
|
||||||
<p><strong><%= format '%.2f', @stats[:poverty_threshold_percent] %>% of goal</strong> ($<%= format('%.2f', @stats[:monthly_revenue]) %> / $<%= format('%.2f', @stats[:poverty_threshold]) %> + $<%= @stats[:expenses] %>)</p>
|
<p><strong><%= format '%.2f', @stats[:poverty_threshold_percent] %>% of goal</strong> ($<%= format('%.2f', @stats[:monthly_revenue]) %> / ($<%= format('%.2f', @stats[:poverty_threshold]) %> / 12 months + $<%= @stats[:expenses] %>)) * 100</p>
|
||||||
<div class="progress progress-striped">
|
<div class="progress progress-striped">
|
||||||
<div class="bar" style="width: <%= format('%.2f', @stats[:poverty_threshold_percent]) %>%;"></div>
|
<div class="bar" style="width: <%= format('%.2f', @stats[:poverty_threshold_percent]) %>%;"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>Neocities earns average US developer salary:</p>
|
<p>Neocities earns average US developer salary:</p>
|
||||||
<p><strong><%= format '%.2f', @stats[:percent_until_developer_salary] %>% of goal</strong> ($<%= format('%.2f', @stats[:monthly_revenue]) %> / $<%= format('%.2f', @stats[:average_developer_salary]) %> + $<%= @stats[:expenses] %>)</p>
|
<p><strong><%= format '%.2f', @stats[:percent_until_developer_salary] %>% of goal</strong> ($<%= format('%.2f', @stats[:monthly_revenue]) %> / ($<%= format('%.2f', @stats[:average_developer_salary]) %> / 12 months + $<%= @stats[:expenses] %>)) * 100</p>
|
||||||
<div class="progress progress-striped">
|
<div class="progress progress-striped">
|
||||||
<div class="bar" style="width: <%= format('%.2f', @stats[:percent_until_developer_salary]) %>%;"></div>
|
<div class="bar" style="width: <%= format('%.2f', @stats[:percent_until_developer_salary]) %>%;"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Add table
Reference in a new issue