NUMBER FORMATS 
Author Message
 NUMBER FORMATS

Hello-

I'm having difficulty finding out how to format numerical
output in a text file.

My problem:
*I want to output numbers to 2 decimal places, such that the
decimal places are aligned in columns.

*Is there a way right justify numerical output?  Everything
I've tried left justifies numbers.

*I've tried converting the numbers to strings and manipulating
that way.  Problems arise when the number is >0, but <1 (ie
0.02). When converting to string, it eliminates the zeros when
printed to the output (it prints " . 2").

Any help is greatly appreciated.

Rob M.



Mon, 17 Aug 1998 03:00:00 GMT  
 NUMBER FORMATS

Quote:


>Subject: NUMBER FORMATS
>Date: 29 Feb 1996 21:24:25 GMT
>Hello-
>I'm having difficulty finding out how to format numerical
>output in a text file.
>My problem:
>*I want to output numbers to 2 decimal places, such that the
>decimal places are aligned in columns.
>*Is there a way right justify numerical output?  Everything
>I've tried left justifies numbers.
>*I've tried converting the numbers to strings and manipulating
>that way.  Problems arise when the number is >0, but <1 (ie
>0.02). When converting to string, it eliminates the zeros when
>printed to the output (it prints " . 2").
>Any help is greatly appreciated.
>Rob M.

Dim var As String * n
Rset var = Format(mystring, "Fixed")
Printer.Print tab(x); var
or you can use Printer.CurrentX


Wed, 19 Aug 1998 03:00:00 GMT  
 NUMBER FORMATS
Another APProach might be using Rset
TmpStr = string(8,32)
rset tmpstr = (format(str(.02),"0.00"))
Curt


Quote:


>>*Is there a way right justify numerical output?  Everything
>>I've tried left justifies numbers.

>Just add spaces to the number. Like:

>Print #1, String$(10 - Len(Cstr(number)), " ")

>to print numbers aligned right within a 10 character area.

>>*I've tried converting the numbers to strings and manipulating
>>that way.  Problems arise when the number is >0, but <1 (ie
>>0.02). When converting to string, it eliminates the zeros when
>>printed to the output (it prints " . 2").

>That should be ".02", right?


>--
>Newbiehood is not a period of time, it's a way of life.

>http://www.sn.no/~balchen
>ftp://ftp.sn.no/user/balchen/



Wed, 19 Aug 1998 03:00:00 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How to convert number format to date format

2. "Accounting" Number Format

3. Access 97 and signed number formats

4. Number format and regional settings

5. microsoft outlook phone number formatting

6. Number format in Access 2000

7. Number Format in UserFrom Lables and Text Boxes

8. Problems with number format

9. Change Phone Number Format

10. Number formatting

11. Number format

12. Telephone number formatting

 

 
Powered by phpBB® Forum Software