More accurate division in Python

This Python script will calculate a fraction to a specified number of digits. It's more accurate than Python's built-in division function.

If you don't have Python, you can download it here. def div(num1, num2, dec): result = "" count = 0 if num2 == 0: return "Error" else: for i in range(dec): count = 0 while num1 >= num2: num1 -= num2 count += 1 result += str(count) if "." not in result: result += "." if num1 == 0: break else: num1 *= 10 return result