-
Jan 30th, 2007, 07:11 AM
#1
Thread Starter
Addicted Member
number to fixed width right aligned string?
Hi All
I want to know if there is any function in VB6 which is like STR function in SQL Server.
STR function takes three arguments viz. number to be formatted, width of resulting string and decimal places required.
I want such function in VB6 where if I supply number, total width and decimal places required, I will get a string right aligned within specified width. If number is smaller, it must get padded with spaces.
I hope VB6 must be having such a basic function.
Please help
Thanx
-
Jan 30th, 2007, 07:26 AM
#2
Re: number to fixed width right aligned string?
Nope, but it's easy enough to write one...
Use Format (or Round) to get the number of decimal places you want, then use the Space function (using Desiredlength - Len(roundednumber)) to create the spaces in front of it.
-
Jan 30th, 2007, 07:32 AM
#3
Thread Starter
Addicted Member
Re: number to fixed width right aligned string?
Thank you.
I am doing the same now.
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
|