Hello and welcome to our community! Is this your first visit?
Enjoy an ad free experience by logging in. Not a member yet? Register.

# Thread: Decimal point.

1. ## Decimal point.

dear,

i do the calculation of divide, and i get 7 decimal point values(23.1234567) but i want it to be 4 decimal digits : 23.1234

how? i tried Cdbl(Total) , but it still get the 23.1234567 and not 23.1234

• someone will correct me if I'm wrong, but maybe you could use the split function at the decimal point and the left function at 4 digits.

• if you always have 7 values after the decimal point, then you can use this :

dim lenght
lenght = Len(string) - 3 'gives you the length - 3
Left(string,lenght) 'gives you the string without the last three caracters

you might also want to check on this :
does ASP have a Ceil function?

using a split function on the decimal point is not the way to go. i'm from belgium an we are that crazy that we use the . and the , in the oppisite way. like this 20.000,32566 so if you would like to use a split unction, you should check the LCDI of the user

• Use the FormatNumber() function. The split() function is for strings.

• There's a data type just for currency.

Try: TheResult = CCur(operand) / CCur(Divisor)

TheResult should end up in currency format.

• <% = Round(23.1234567,4) %> will give you:

32.1235

Is that what you need?

•

#### Posting Permissions

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