# Division without the reminder

## Recommended Posts

Hi,

can I divide a number without the reminder? For example I have a \$number = 9587 and I need to know how many thousands it is (the result should be 9).

The reason is I want to refine the output like this:

```\$Number = 9578
\$Output = Round(\$Number/1000) & "." & Mod(\$Number, 1000)
Msgbox (0, "Result:", \$Output)```

Due to rounding the result looks like this: "10.587" but it should be like "9.587".

Thank you.

##### Share on other sites

AutoMathic,

Like

`Msgbox (0, "Result:", stringformat('%04.3f',\$number/1000))`

?

kylomas

Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

##### Share on other sites

A few more methods.

```\$Number = 9578
\$Output = Round(\$Number / 1000, 5) ; Round ( expression [, decimalplaces] )
; Or
\$Output1 = Int(\$Number / 1000) & "." & Mod(\$Number, 1000)
;Or
\$Output2 = \$Number / 1000
MsgBox(0, "Result:", \$Output & @CRLF & \$Output1 & @CRLF & \$Output2)```

##### Share on other sites
`Msgbox(0,"", StringRegExpReplace(9578, '(?=\d{3}\$)', "."))`

## Create an account

Register a new account

• ### Recently Browsing   0 members

×

• Wiki

• Back

• #### Beta

• Git
• FAQ
• Our Picks
×
• Create New...