Formula Problem
colander
Member Posts: 1,610
I am creating a marketing budget app for a client and I have this formula "Total\32$"..prec(tableColSum( game.tblTemp ,1,1,29),2) in an actor which updates the total cost automatically as values are changed in other actors. The result i.e. $12000.00 doesn't have a thousand separator, does anyone know if this can be done in a formula and how to do it?
In the backend of the app I used modulus to add a separator but in that case because the user taps the actors I can use that event to run the code. In the above case it is display only and needs to update on the run as the user selects items for their budget.
If it can't be done with a formula is there another way to do this?
Comments
If you use a Display Text behavior, it constrains the value of the expression, so it will constantly update.
If you use a custom font (.png image for each digit) then you would be using a constrain behavior, so it will constantly update.
I guess I don't see the problem...?
New to GameSalad? (FAQs) | Tutorials | Templates | Greenleaf Games | Educator & Certified GameSalad User
@tatiang that's not the issue the problem is it doesn't have a "," separator like $12,000.00 I don't think my formula can be modified to do this but I thought I would ask the question in case someone knows a way to do it.
Universal Binary Template - Universal Binary Template Instructions Rev 4 (Short) - Custom Score Display Template
@tatiang ahh! I got it you mentioned constrain I don't know why I didn't think of that. I constrained my table cell value to an attribute and then used modulus to reconstruct the number and format it. It would be a lot easier if their was a function/formula to do this.
Universal Binary Template - Universal Binary Template Instructions Rev 4 (Short) - Custom Score Display Template