Link to home
Start Free TrialLog in
Avatar of raybetts
raybettsFlag for United Kingdom of Great Britain and Northern Ireland

asked on

vb.net (.net 1.1) double question

My app receives double values through e.g. 8740

From the calling app, this translates to £87.40

But when I save it in my audit table (and I understand why it does it this way) it is £8740.00.

Is there something in the .net framework to achieve my goal (place a decimal place in the right place and not on the end) or will I need to write a small function?

Thanks
Avatar of GlobaLevel
GlobaLevel
Flag of United States of America image

your audit table column takes incoming data and recast to how you have your table set up..recast the column in your sql to format the data correctly..
Avatar of srikanthreddyn143
srikanthreddyn143

Is it possible to provide your code?
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
post code here..so we can look..absolutely...I was just wanted you to be sure the SQL side columns were data cast correctly...make sure you take out your personal info b4 u upload...
This is ugly, but works:
' dbl = 8740

dbl = Mid(dbl, 1, CStr(dbl).Length - 2) & "." & CStr(dbl).Substring(CStr(dbl).Length - 2)

Open in new window

Avatar of raybetts

ASKER

Amazing how the brain struggles after 9 hours!!  

A simple solution that I am gutted I couldn't see myself with my aching brain!  Thanks :)