vb.net (.net 1.1) double question

raybetts
raybetts used Ask the Experts™
on
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
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
GlobaLevelProgrammer

Commented:
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..
Is it possible to provide your code?
Most Valuable Expert 2012
Top Expert 2014
Commented:
If the value always has 2 decimal digits then you can simply divide it by 100 before saving to the DB.

Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

GlobaLevelProgrammer

Commented:
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...

Commented:
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

Author

Commented:
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 :)

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial