Skip to content

Commit d3929f9

Browse files
author
chrislsavage
committed
Check it out later
1. When the input was 503394930 and 43 your output was incorrect. 2. When the input was 101077282 and 21123 your output was incorrect.
1 parent 4ff9bf1 commit d3929f9

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

DivisionStringified.rb

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
def DivisionStringified(num1,num2)
2-
num = num1/num2
3-
if num <= 0
4-
return "1"
5-
end
2+
num = (num1.to_f/num2.to_f).round
63
num = num.to_s.split("")
74
i = num.length - 3
85
while i >= 0
@@ -15,4 +12,4 @@ def DivisionStringified(num1,num2)
1512

1613
# keep this function call here
1714
# to see how to enter arguments in Ruby scroll down
18-
DivisionStringified( 503394930 ,43)
15+
DivisionStringified( 503394930 ,43)

0 commit comments

Comments
 (0)