Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
8 replies
Subscribers
7 subscribers
Views
2279 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
gridRowLayout column displaying number incorrectly
garym
over 7 years ago
Hi,
We are using a grid and one of the columns is Quantity. Unbeknownst to me, it is possible that they could have a decimal value in this field. From the screenshot that I provided, the column to the right of Quantity is Unit Rate and the rule!APN_dollar has been applied to that column and it displays nicely. However, I want to do the same thing for Quantity but I don't want the $ sign. Is there an equivalent function that I can use to just show the decimal value?
a!textField(
label: "UoM " & ri!index,
value: ri!items[ri!index].unitOfMeasure_txt,
readonly: true
),
a!textField(
label: "Quantity " & ri!index,
value: ri!items[ri!index].quantity_int,
readonly:true,
align: "RIGHT"
),
a!textField(
label: "Unit Rate " & ri!index,
value: rule!APN_dollar(ri!items[ri!index].unitRate_dec,true),
readonly:true,
al...
OriginalPostID-236208
Discussion posts and replies are publicly visible
0
garym
over 7 years ago
...ign: "RIGHT"
),
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sanjays0006
over 7 years ago
Check fixed function once from
forum.appian.com/.../Text_Functions.html
I think this should solve your issue
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
garym
over 7 years ago
Thanks sanjays. Do I need to use the apply function with the fixed?
a!textField(
label: "Quantity " & ri!index,
/*value: ri!items[ri!index].quantity_int,*/
value: apply(fixed(ri!items[ri!index].quantity_int,2)),
readonly:true,
align: "RIGHT"
),
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Jamie Loizou
Appian Employee
over 7 years ago
You'll need to apply the function since you are using it for each item in the array of values.
Updated code:
a!textField(
label: "Quantity " & ri!index,
/*value: ri!items[ri!index].quantity_int,*/
value: apply(fixed(_,2), ri!items[ri!index].quantity_int),
readonly:true,
align: "RIGHT"
),
Sample code:
apply(fixed(_,2), {2.003, 4.552, 7})
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
sanjays0006
over 7 years ago
Gary,
I think you should use the apply function.
But in the code you have attached, even for the rule!APN_dollar function, you should be using the apply function.
But you are not using it.
Are you able to display the grid that was displayed with the code you mentioned above?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Jamie Loizou
Appian Employee
over 7 years ago
Gary - my apologies, I had thought this was a paging grid rather than an editable grid. You don't need to apply because you're only dealing with one item in the array at this editable grid's textField. Using the apply() function as I suggested above will still work, but it isn't necessary.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
garym
over 7 years ago
OK thanks. That worked for me. I did use the apply() function but as you said, it isn't necessary but will work.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
PhilB
Certified Lead Developer
over 7 years ago
Partial evaluation isn't necessary in this case: apply(fixed(_,2), {2.003, 4.552, 7})
Instead you can do: apply(fn!fixed, {2.003, 4.552, 7}, 2)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel