Solved

# CDEC does not work when my application is put online

Posted on 2004-11-07
379 Views
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
Question by:rangers99

LVL 28

Expert Comment

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

Hi again

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

LVL 44

Accepted Solution

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

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

AW
0

## Featured Post

Sometimes in DotNetNuke module development you want to swap controls within the same module definition.  In doing this DNN (somewhat annoyingly) swaps the Skin and Container definitions to the default admin selections.  To get around this you need t…
In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…