This has to be dead easy but I’m not getting it. What is the easiest way to get the total of a floating point field to display as dollars and cents in a text display object?
I have #.,## selected under output pattern under field properties in the sheet, and it displays correctly in the sheet.
For the TDO I have the field name in the Formula. I tried to apply a pattern to the formula but no luck.
When I run my procedures that create the total, sometimes it displays correctly and sometimes throws in 3-5 extra decimal places. Seems random.
I also found some notes from Jim on changing the blueprint but my one small attempt to tinker with that was rejected. A little knowledge etc. etc.
That’s probably part of a larger error message. If your field isn’t named total, you should change that to whatever it is named. Otherwise, you could enlarge the object so that you can see the rest of the error message.
pattern(QO_Extended,"$#.,##") – this gives me an expression parsing error. Looks identical in format to Gary’s formula so I don’t know why it doesn’t work. If I remove the $ sign it works fine.
Got it. For no good reason–since I don’t know what it does–under the TDO options I accidentally had selected the mode “Evaluate Formula Twice”. Changing it back to “Formula” solves the $ problem.
It evaluates the formula once, and then interprets the resulting text as a formula, and then evaluates that formula. The final result is the result of the generated formula. I don’t think this feature was used very often, but Panoramas 3 through 6 had it, and there are bound to be users who do use it.
I think it was very rarely used. The reason it was originally put in was to provide a way to get around the 255 character limit for a Text Display formula. You could put a formula of any length into a variable, specify that variable as the formula, then use the “evaluate twice” option. The result would be the value of the formula that had been put in the variable.
In Panorama X Text Displays formulas can be any length, there is no longer a 255 character limit, so there is no need for this option. However, it is included in case someone brought over a Panorama 6 database that used the option, so that it would work out of the box. (I know some of you think that little or no effort was put into maintaining Panorama 6 compatibility in Panorama X, but actually a huge amount of effort was put into this, probably at least a year out of the 6 year project, maybe even 2 years. It would have been significantly easier/faster to create Panorama X if Panorama 6 compatibility wasn’t an issue.)