If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Formating decimal places in an unbound field
Hi, I have an unvound control which contains some text as well as the
following code: & [Score]*100/[MaxMarks] & " How do I restrict the calculation above to 0 places of decimal. i tried setting the control properties, but that seems to have no effect Thanks A |
#2
|
|||
|
|||
Formating decimal places in an unbound field
Set the Format to Fixed, as well as Decimal Places to 0.
-- 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. "Alex" wrote in message ... Hi, I have an unvound control which contains some text as well as the following code: & [Score]*100/[MaxMarks] & " How do I restrict the calculation above to 0 places of decimal. i tried setting the control properties, but that seems to have no effect Thanks A |
#3
|
|||
|
|||
Formating decimal places in an unbound field
hi Alex,
Alex wrote: Hi, I have an unvound control which contains some text as well as the following code: & [Score]*100/[MaxMarks] & " How do I restrict the calculation above to 0 places of decimal. i tried setting the control properties, but that seems to have no effect Of course, as a string can't be formatted. Use the CInt(), Int() or Fix() function, e.g. CInt([Score]*100/[MaxMarks]). mfG -- stefan -- |
#4
|
|||
|
|||
Formating decimal places in an unbound field
Alex wrote:
Hi, I have an unvound control which contains some text as well as the following code: & [Score]*100/[MaxMarks] & " How do I restrict the calculation above to 0 places of decimal. i tried setting the control properties, but that seems to have no effect Use the Format function to get whatever formatting you want: .... & Format(Score*100/MaxMarks, "#,##0") & ... -- Marsh MVP [MS Access] |
#5
|
|||
|
|||
Formating decimal places in an unbound field
Thanks All
A "Alex" wrote in message ... Hi, I have an unvound control which contains some text as well as the following code: & [Score]*100/[MaxMarks] & " How do I restrict the calculation above to 0 places of decimal. i tried setting the control properties, but that seems to have no effect Thanks A |
Thread Tools | |
Display Modes | |
|
|