Formating decimal places in an unbound field

  • Thread starter Thread starter Alex
  • Start date Start date
A

Alex

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
 
hi Alex,
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 <--
 
Alex said:
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") & ...
 
Back
Top