Dr. Evil Posted May 15, 2014 Posted May 15, 2014 Hello, thanks for your interest. Looking for assistance in fixing my calculation to properly format currency. Â This calculation is a note on a report, noting if their line item is discounted or not, only populating if there IS a discount. Â I've attached images of what I have and of what Im looking for. Maybe with proper currency formatting of calculation, I can trim the extra lines of adding the "$" . Â THANK YOU for any help with this one!
eos Posted May 15, 2014 Posted May 15, 2014 Let's just say that whenever you can, use the layout's formatting option. If this is a just a note on the layout, create a text object with the note text and a merge field ( i.e. the text '(w/ discount $<<subtotal>>)' ) and use 'font size = 500' Conditional Formatting if not discount_rate. As to your calculation (and next time please kindly post the code, not a graphic – we all know how that dialog looks ), you could simplify it as Case ( discount_rate ; " (w/ discount " & TextStyleAdd ( "$" & subtotal ; bold ) & ")" ) P.S.: Wouldn't the discount rate itself also be worth mentioning?
Dr. Evil Posted May 15, 2014 Author Posted May 15, 2014 eos...  Noted on the posting code, not just image, rookie. lol  I'll most likely do as you suggest, using merge fields and conditional formatting. Guessing this is less load on the system. Only issue I have with this method, is I can not have discount_note in line with the fee, otherwise if there is a discount, I'll loose the whole line. If I separate, as would be needed for this to work, then I have a structured column and a gap between discount_note and fee to allow for variable amount and the space taken.  On the calculation revise you gave me, it does not format the 2 place decimal. For example, $224.20 will populate as $224.2.  Regarding the P.S. I have attached the whole picture on what my estimate looks like. I very much welcome any feedback!  Thanks for your help eos!
eos Posted May 15, 2014 Posted May 15, 2014 Not sure I understand the problem: if you create the discount note as merge field and place it as a single, right-justified object before the undiscounted line item - which is a separate field or merge object! – and apply CF, it's either visible or not, but shouldn't impact the display of the other object. To the PS: you're mentioning that a discount has been applied, but not what it is; I thought this might be worth mentioning, but then again, maybe your clients customer are happy enough to simply receive it … Decimal places: If you have a merge field/object, you can apply the Inspector's formatting options to it, i.e. two decimal places. If in a calculated text block you want to ensure a certain number of decimal places for a currency, you need to program it; there are CFs that care of it, but since you don't have FM Advanced, do it yourself: Case ( discount_rate ; Let ( [ ~s = subtotal ; ~i = Int ( ~s ) ; ~d = ( ~s - ~i ) * 100 ; ~d = SerialIncrement ( "00" ; ~d ) ] ; " (w/ discount " & TextStyleAdd ( "$" & ~i & "." & ~d ; bold ) & ")" ) )
Dr. Evil Posted May 15, 2014 Author Posted May 15, 2014  Not sure I understand the problem: if you create the discount note as merge field and place it as a single, right-justified object before the undiscounted line item - which is a separate field or merge object! â and apply CF, it's either visible or not, but shouldn't impact the display of the other object.  Only issue... Maybe I'm missing something, or you know a trick to fix this. I know I'm being petty, but I don't like the hard gap between the discount note and the fee
eos Posted May 15, 2014 Posted May 15, 2014 I know I'm being petty, but I don't like the hard gap between the discount note and the fee Combine both into a single merge object – or create a single calculation field that calculates the entire string. Be creative, that's your job, IIUC … PS: When I said clients might be interested in seeing the actual discount, I meant the rate applied (i.e. '"w/ " & discount_rate & "% discount:" …'), not the amount saved. This design looks a bit too busy to my non-designer's eyes…
Dr. Evil Posted May 16, 2014 Author Posted May 16, 2014 (edited) Thanks for your assistance eos! Â I've settled, for now, with the attached layout. Just using merge fields, separated from the merge field total's. Discount notes only appear if there are discounts. Â Â Not shown in attachment; I changed subtotal discount note to match format of line item discount note. Edited May 16, 2014 by Dr. Evil
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now