Jump to content

Old Russian measure of length: Difference between revisions

→‎{{header|Ruby}}: add to_others method
(→‎{{header|Ruby}}: add to_others method)
Line 2,225:
RATIOS[from] * arg / RATIOS[to]
end
 
def self.print_others(name, num)
puts "#{num} #{name} ="
RATIOS.except(name.to_sym).each {|k,v| puts "#{ (1.0 / v*num)} #{k}" }
end
end
 
Distances.print_others("meter", 2)
puts
p Distances.meter2centimeter(3)
p Distances.arshin2meter(1)
Line 2,235 ⟶ 2,241:
</lang>
{{out}}
<pre>300.02 meter =
2.8121484814398197 arshin
200.0 centimeter
78.74015748031496 diuym
6.561679790026246 fut
0.002 kilometer
787.4015748031495 liniya
0.00026782366489903046 milia
11.248593925759279 piad
0.9373828271466067 sazhen
7874.0157480314965 tochka
44.994375703037115 vershok
0.0018747656542932134 versta
 
300.0
0.7112
21.336
1,149

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.