Re: export numeric field right alligned



Salad wrote:

janssensglb@xxxxxxxxxx wrote:

Don't fill the leading blanks with zero's but with spaces...

Arno R



I'm not sure how I can do that.
If the value of the record is eg. 1.23, I need to fill 6 leading
blanks with spaces. If the value is 1234.56, I need to fill 3 leading
blanks with zeros.
Can I do this using the format function?
Thanks


a = 123.45
? Right(string(10," ") & a,10)
123.45
or
? Right(string(10,space(1)) & a,10)
123.45

Hmmmm...I decided to check for a number like 123.50.
a = 123.50
? Right(string(10,space(1)) & a,10)
123.5
? Right(string(10,space(1)) & format(a,"0.00"),10)
123.50
You might want to format to keep the ending 0's.
.


Quantcast