# Thread: Dividing numbers

1. Member
Join Date
Jul 2012
Posts
1
Rep Power
0

## Dividing numbers

Right, I am kind of sorry for bothering you guys with a beginner question like this, but I cannot get over this relatively simple problem.

So, I have this number, lets say, 12345678 and I want to turn it into number 12,3456789. How do I do that? 12345678/1000000 outputs 12.
Last edited by Pootis; 07-31-2012 at 01:02 PM.

2. ## Re: Dividing numbers

That's how integer division works: it throws away any fraction (digits right of the decimal point); if at least one of the operands isn't an int, 'normal' division is applied; (hint 1000000.0 isn't an int).

kind regards,

Jos

3. Moderator
Join Date
Apr 2009
Posts
13,234
Rep Power
23

## Re: Dividing numbers

1000000.0
Without that it is treated as integer division, which gives an integer result.

4. Moderator
Join Date
Apr 2009
Posts
13,234
Rep Power
23

## Re: Dividing numbers

I knew I should have refreshed the page....

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•