irb
allocation = {
events: 3_131_647.7,
fanout: 1_234_271.5,
default: 17_179_872,
detonation: 705_552.8,
assets: 4_664_397
}
sum = allocation.values.reduce(&:+)
allocation.each do |k, v|
puts "#{k}: #{((v/sum)*100).round(0)}"
end
=> {:events=>3131647.7, :fanout=>1234271.5, :default=>17179872, :detonation=>705552.8, :assets=>4664397}
=> 26915741.0
=> {:events=>3131647.7, :fanout=>1234271.5, :default=>17179872, :detonation=>705552.8, :assets=>4664397}