conversion

1. Join Date
Dec 1969
Posts
42

## conversion

hi..im trying to conver a string to a single..but the problem is : i have a text field where users can insert a dimension<BR>so..if if they insert i.e 27.3 using CSng or Round it simply returns 273..it just dismisses the floating point..how can i get over this? thanx on advance

2. Senior Member
Join Date
Dec 1969
Posts
16,931

## RE: conversion

Convert to a double?<BR><BR>Craig.

3. Join Date
Dec 1969
Posts
42

## RE: conversion

tried it..nope

4. Senior Member
Join Date
Dec 1969
Posts
5,104

## Show some code. I've done this and it works.

Show use the code that you are using and the exact output of it.<BR><BR>I can&#039;t imagine that CDbl doesn&#039;t work. I&#039;ve done it a thousand times.<BR><BR>-Doug

5. Join Date
Dec 1969
Posts
42

## RE: Show some code. I've done this and it wor

userHeight = Request.Form("txtHeight") --- with input 12.3<BR><BR>&#060;p class="font"&#062;&#060;b&#062;&#060;%=userHeight% &#062; mm&#060;/b&#062;&#060;/p&#062; --- it returns 12.3<BR><BR>UpperHeight = CDbl(userHeight) <BR>Response.Write UpperHeight -- it returns 123

6. Senior Member
Join Date
Dec 1969
Posts
5,104

## I get different results:

My Code:<BR>&#060;%<BR>Dim userHeight<BR> userHeight = "12.3"<BR> &#039;userHeight = Request.Form("txtHeight")<BR>%&#062;<BR>&#060;p class="font"&#062;&#060;b&#062;&#060;%=userHeight% &#062; mm&#060;/b&#062;&#060;/p&#062;<BR>&#060;%<BR>UpperHeight = CDbl(userHeight) <BR>Response.Write UpperHeight<BR>%&#062;<BR><BR>My Results:<BR><BR>&#060;p class="font"&#062;&#060;b&#062;12.3 mm&#060;/b&#062;&#060;/p&#062;<BR>12.3<BR><BR>-Doug

7. Join Date
Dec 1969
Posts
42

## RE: I get different results:

ok i got it..i think..basically my floating point is "," and not "."..how can i change it to the dot ..control panel??

8. Senior Member
Join Date
Dec 1969
Posts
5,104

## It could be regional settings... not sure, though.

-Doug

9. Senior Member
Join Date
Dec 1969
Posts
623

## There was a post...

...a couple of days ago about the same thing and Bill W had said that it sure was some regional settings (german if I wasn&#039;t dead drunk) but I can&#039;t get to yesterdays or the day be4&#039;s post.<BR><BR>It is the top few chunks of messages i guess

10. Senior Member
Join Date
Dec 1969
Posts
623

## RE: There was a post...

http://www.aspmessageboard.com/forum/showMessage.asp?F=20&M=350319&P=1

#### Posting Permissions

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