Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

CDEC does not work when my application is put online

Posted on 2004-11-07
5
Medium Priority
?
385 Views
Last Modified: 2008-02-20
Hi

Ive developed an ASP.NET based website using VisualBasic.NET. I set up IIS so I could test the program as though it was on the Internet. It worked fine.

Ive now FTPed my site to a server so I can access on the Interent. The web pages look fine but the 'code behind' isn't behaving as it should. eg.

I have a string s = "-2,345.00"
When i do X = cdec(S) then x should be -2,345.00

However Im getting an exception that says it is illgal to convert this string to a decimal.
As I say this works fine on my standalone PC but it fails when I put the program online.

Any ideas?
0
Comment
Question by:rangers99
  • 2
  • 2
5 Comments
 
LVL 28

Expert Comment

by:mmarinov
ID: 12521257
Hi rangers99,

look what is written for the CDec
CDec Decimal +/-79,228,162,514,264,337,593,543,950,335 for zero-scaled numbers, that is, numbers with no decimal places. For numbers with 28 decimal places, the range is
+/-7.9228162514264337593543950335. The smallest possible non-zero number is 0.0000000000000000000000000001.

so because you have been tring to convert a number grater that 7.9228162514264337593543950335 and you have decimal places you won't be able to do that

try with

s="-2,345"
CDec(s)

Regards!
B..M
mmarinov
0
 

Author Comment

by:rangers99
ID: 12522250
Hi again

Thanks for the reply. Ill give this a shot but it frankly doesn't ring true!!
0
 
LVL 44

Accepted Solution

by:
Arthur_Wood earned 750 total points
ID: 12522842
it should ne noted that this line (from the definition of CDEC)

 For numbers with 28 decimal places, the range is +/-7.9228162514264337593543950335

means that when you want 28 digits after the decimal point that is the range,
when 27 difits to the right:

+/-79.228162514264337593543950335

with 26:

+/-792.28162514264337593543950335

and so on:

so "-2,345.00"
  should NOT be a problem.  The problem amy lie with the ','  try:  "-2345.00"

AW
0
 

Author Comment

by:rangers99
ID: 12530792
That was it AW. The comma was not accepted. I wrote a small function to remove commas from a string. Thanks
0
 
LVL 44

Expert Comment

by:Arthur_Wood
ID: 12540424
glad to help.

AW
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Screencast - Getting to Know the Pipeline
Suggested Courses

580 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question