|
-
Nov 24th, 2003, 09:49 AM
#1
Wanna help a sick man? Positive to negative.(Resolved)
Ok guys bare with me here. Im am very ill right now and have some last minute work I HAVE to get done. So I usually could get this donme on my own, but I am so sluggish I cant think.
Ok I have a dollar amount coming from a text file. Looks like this
000001344{
I have already done the conversion to make that 00000134.40 (The { symbol determines the 0, its a mainframe thing)
Anyway, there is another part of the recrod that determines it should be turned into negative. Main problem is, this has to be retained as a string value because the new amount is going back into another text file, plus it has to be formated with any leading zeros. So I cant simply convert to a numeric value and multiply by -1 because zeros have to be retained and some more added
The final format has to be 12 characters long, including the negative symbol and decimal point.
Anyone want to help me out for a change?
Last edited by Cander; Nov 24th, 2003 at 11:46 AM.
-
Nov 24th, 2003, 11:39 AM
#2
Can't you just custom format after its a number? Something like this:
VB Code:
Dim num As Single = Single.Parse("00000134.40")
num = num * -1
MsgBox(num.ToString("000000000.00;-00000000.00"))
-
Nov 24th, 2003, 11:46 AM
#3
yeah I found it out a couple minutes ago. That is pretty much what I did. My brain kind of blocked out the Format function
-
Nov 24th, 2003, 11:50 AM
#4
I'm the exact same way when I'm sick.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|