PC Review


Reply
Thread Tools Rate Thread

Aligning number values

 
 
John
Guest
Posts: n/a
 
      29th Jan 2006
Hi

I need to right justify amounts in a field with width of x digits. I have
tried Format(2.35, "##########0.00") but the numbers come out left
justified. Anyway to justify them on the right like the currency amounts
should be?

Thanks

Regards


 
Reply With Quote
 
 
 
 
Allen Browne
Guest
Posts: n/a
 
      29th Jan 2006
The Format() function generates a string, and Access therefore treats it as
text.

Could you set the Format property of the text box instead of using the
Format() function? Not only would it align as a number, but you could
perform math on it (e.g. sum or average.)

If you want to treat it as text anyway, you could right-align the text box.
(Toolbar icon in design view.)

If you are trying to calculate the actual width on a report, see:
http://www.lebans.com/textwidth-height.htm

--
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"John" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>
> I need to right justify amounts in a field with width of x digits. I have
> tried Format(2.35, "##########0.00") but the numbers come out left
> justified. Anyway to justify them on the right like the currency amounts
> should be?



 
Reply With Quote
 
lesperancer@natpro.com
Guest
Posts: n/a
 
      30th Jan 2006
try format(Format(2.35, "##########0.00"),string(12,"@"))
to right justify in a 12-character field

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Aligning Two Columns by common number Andrew Microsoft Excel Worksheet Functions 2 18th Dec 2008 06:55 PM
Compare two columns by aligning same-values and spacing out differences Jon Davis Microsoft Excel Worksheet Functions 1 12th Dec 2007 02:55 AM
Aligning Two Sets of Data That Share Only Some Values =?Utf-8?B?a29ya2V5XzIwMDM=?= Microsoft Excel Programming 2 6th Sep 2007 01:14 AM
Aligning decimal numers to the centre of the cell and aligning dec =?Utf-8?B?UmFtZXNoIEJhYnU=?= Microsoft Excel Misc 1 1st Jul 2006 10:33 PM
right aligning values in datagrid column nemo Microsoft ASP .NET 1 16th Sep 2005 03:58 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:45 AM.