CDEC does not work when my application is put online


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?
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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


rangers99Author Commented:
Hi again

Thanks for the reply. Ill give this a shot but it frankly doesn't ring true!!
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:


with 26:


and so on:

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


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rangers99Author Commented:
That was it AW. The comma was not accepted. I wrote a small function to remove commas from a string. Thanks
glad to help.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.