Unit Prices to be as integers

hi,

I have my unit prices eg(1000.1234) and in my sales invoice in need to be displayed as 1000.

i have tried it by changing the properties ->decimal field to 0 but still i can see the complete number in the invoice.

harsha

Hi Harsha,

You need to use the Format-property for this.
If you define as the format property of the text-box control, then decimal values will be presented to the user as integers, still with seperators at thousands.

Hi Alex,

Thank you for the quick response.

I tried this but still dose not work.

what i did:

  1. went to the properties of the unit price and changed the format option. save → compile

I can still see the unit price as 1000.1234 in my invoice.

harsha

???

Well it works fine here.
Did you clear the object cache afterwards?

Also remember this only works in the object you modified.
DB still contains the decimal datatype.

Hi Harsha,

Are you talking about the form or the print of the invoice?

hi Dave,

I am talking about the report(sales invoice No.206).

harsha

Hi Harsha,

This is picking up the AutoFormatType/AutoFormatExpr from the sale invoice line table for the field “unit price”

Possible solutions:

  1. Set the source expression to “Unit Price”*1 which gives the sames value but does inherit the expressions

  2. use the round function

  3. use a variable MyPrice := “Unit Price”

  4. Amend the Sales Invoice Line table properties if this format is not standard

Hi,

thank you for your response.

I tried all the options that u gave me.

1.the first option had no effect.(Set the source expression to “Unit Price”*1).

2.rounding function will change my price and with large quantities sold the difference will be quite significant.

3.the format is standard so i need not change the table.

the problem is my unit price(inc vat) is for eg : “1200.045” i just need to display 1200.

thanks

harsha

Hi Harsha,

  1. You need to set the decimal places / format property in conjunction (It worked for me)

  2. use the round in the source expression or use a variable to store the rounded result as per 3