Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

This topic is 3901 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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! :)

post-80154-0-47724400-1400180583_thumb.p

post-80154-0-90386900-1400180593_thumb.p

Posted

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  :laugh: ), 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?

Posted

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!

post-80154-0-03445600-1400184648_thumb.p

Posted

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 ) & ")"
  )
)
Posted

 

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

post-80154-0-89073000-1400191350_thumb.p

Posted

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 …  :laugh:

 

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…

Posted (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.

post-80154-0-45634400-1400262397_thumb.p

Edited by Dr. Evil

This topic is 3901 days old. Please don't post here. Open a new topic instead.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.