This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function inHoursFilter(mins) { | |
| // Return String with Qty of Hours and Mins | |
| // REFACTOR! | |
| var total = Math.round((parseFloat(mins)/60)*100)/100, | |
| hours = Math.floor(total), | |
| minutes = Math.round(parseFloat('0.'+ total.toString().split('.')[1]) * 100 ) / 100, | |
| result = ""; | |
| if( hours === 0) { | |
| return mins + ' mins'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| octal, ipv4, input = [128, 64, 32, 16, 8, 4, 2, 1], [[],[],[],[]], nil | |
| while input.nil? || input.split('.').size != 4 do | |
| puts "Ingrese IPv4 a convertir" | |
| input = gets.chomp | |
| end | |
| input = input.split('.').map(&:to_i) | |
| ipv4.each_with_index do |binary_set, index| |
OlderNewer