473,796 Members | 2,904 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Aligning number values

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
Jan 29 '06 #1
2 7126
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" <Jo**@nospam.in fovis.co.uk> wrote in message
news:eK******** ******@TK2MSFTN GP12.phx.gbl...

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?

Jan 29 '06 #2
try format(Format(2 .35, "##########0.00 "),string(12,"@ "))
to right justify in a 12-character field

Jan 30 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1819
by: Pascal | last post by:
We have a customer that is encountering a strange situation. He has found that if he has a column defined in the DB as a number it only diplays within the first 7 digits. However if he have the same data in a column defined as number(9) there is not problem. table tmp_customer (custid1 number(9), custid2 number) values (123456789,123456789) when he selects this data using a ORACLE 9 driver in the connection setup he gets:
5
23304
by: Tony Vasquez | last post by:
I want to turn the string "100,144" to numbers, to use for resizeTo(100,144) <--- here. Please advice, or post scriptlette. Thanks Tony Vasquez
8
2006
by: deko | last post by:
Is there a rule of thumb for quoting variable values? For example, do I have to put all string number values in quotes? strAbc = "3" ? What about long, int and byte? I assume these are NOT supposed to be quoted lngID = 4 How about values I get from an unbound textbox?
7
2981
by: Jared | last post by:
Here is my situation. I have multiple labels on a form but only certain ones will become visible while using the form. Depending on which check box(s) you pick, on another form, determines the labels that appear. I have that much working as of now. What I need to know is, how do I format the labels to align underneath one and other. So when I check the first check box, the corresponding label appears and when I check the third check box...
19
5779
by: MLH | last post by:
I'm wondering if the BackColor property values for the colors built-in to A97 come from some internationally recognized standard. I have a list of a hundred or so colors with hex values and I'm wondering if they are compatible.
0
249
by: Frank Neumai | last post by:
Hello! I have a form with a DataGrid, which is bound to a DataView, which comes from a Database. No other fancy settings... myDataGrid.DataSource = myDataView My DB-Table has a Column "salutation" with the possible values 0 (which means for me "Mr.") and 1 (which means for me "Ms.").
10
2415
by: chanma | last post by:
code1:var x=0xf0000000; alert(x); output:4026531840 code2:var b=0xf<<28; alert(b); output:-268435456
2
1872
ddtpmyra
by: ddtpmyra | last post by:
How can I assgined value to each row of my query result? Example Book=1; Fruits=2; Animals=3 OR is there other way to do it? thanks for your help! echo "<tr><td><b>Categories:</b></td>"; $res=mysql_query("select cat_name from categories order by cat_name"); if(mysql_num_rows($res)==0){ echo "there is no data in table..";
1
1244
by: Jah Mason | last post by:
"Numbers.txt" 1 3 5 4 2 /*Currently i have functionality for a user to choose a number of values to be entered into an array, add numbers into the array "numbers" and process the mean, range, variance, maximum, minimum and display the array. Now i'm trying to modify the code to read values from a text file into the array "numbers" and apply the same functions*/
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9535
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10244
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10201
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9061
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7558
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5454
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5582
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4130
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.