Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

item quantity

Avatar

Not applicable

Hi everybody, am in the making of an invoice form, under the item column, I need to be able to put not only full number, but also .25-.50 and .75. when I do so it write only the full number, exemple if I write 3.50, as I go to the next field, it goes back to 3.

Also I can't calculate taxes, with it... is there's a place where I can put a formula like in excell?

Thank's.

3 Replies

Avatar

Level 10

Hi,

You could change the item from a numeric field to a decimal field and then limit the trailing digits (after the decimal place) to "2". This will prevent the user from inputting more than two digits after the decimal place.

Then in the Object / Field tab click on Patters. Set the display pattern to num{zzzz9.ZZ}. The "ZZ" will show two floating zeros after the decimal point.

You have a number of fields which are below the sub-total field (let's say it is called subTotalAmount), call one of these fields taxAmount, then in the calculate event, have something like this in Javascript:

this.rawValue = subTotalAmount * 0.175;

Then your totalAmount would have the following in its calculate event:

this.rawValue = subTotalAmount + taxAmount;

If you have variable tax bands then you could have a series of radio buttons, one for each band. In the Object / Binding tab you would set the percentage tax and then refer to the radio buttons in the taxAmount script instead of the fixed 17.5%.

Good luck,

Niall

Avatar

Not applicable

where can I enter the calculation script?

Avatar

Level 10

Hi,

All script is entered in the "Script Editor". If this is not visible then press"Control + Shift + F5" or go to the Window menu and select "Script Editor".

Once the window is open you can drag the bottom bar to make it as big as you need.

This window allows you to set the event that will trigger/call the script; the script lanuage; and when it will run (mostly at client).

The help file in LC Designer will help you set up the scripting window.

Example is below.

N.