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 4469 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Hello all. I hope you are having a great weekend.

I am running into a problem that basically results in eye candy (nice but not totally necessary) on a report.

As of now, my Starting, Ending and Total Mileages do not have a comma separator. I would like to place a comma in the proper place in these fields.

The only things I can find online that pertains to this do not work for me no matter what I try (and I've spent hours trying). Here is what I have referenced...

Filemaker Help; Formatting Numbers in a Text Calculation Field and

Filemaker Help; How to Handle Formatting Number, Date and Time Merge Fields and Formatted Numbers Within Text Fields.

Here is the code I am using now...

If ( IsEmpty ( Mileage_Starting ); ""; "Starting Mileage: " & Mileage_Starting) & ¶ &

If ( IsEmpty ( Mileage_Ending ); ""; "Ending Mileage: " & Mileage_Ending) & ¶ &

If ( IsEmpty ( Mileage_Total ); ""; "Total Miles: " & Mileage_Total) & ¶ &

"Amount Due: $" & EarnedToday

Please bear in mind that the mileage figures are not always 6 digits in length. The could run anywhere from 1 mile to 1,000,001+ miles.

Also, the .00 on the back end of the Amount Due is not necessary. Most companies use rounded numbers.

Thanks in advance for any help with this matter.

Regards,

Charlie

post-102845-0-83606600-1351956150_thumb.

post-102845-0-92305000-1351956169_thumb.

Posted

Because if there are no mileage figures, say the driver didn't drive that day, then I don't want the field labels appearing on the report as below. If I save the merge field as it is written and as a number, it returns only numbers formatted as below.

post-102845-0-05522800-1351973275_thumb.

post-102845-0-89261600-1351973288_thumb.

Posted

Hey Comment, Here's one for ya'...

Using the NumToJText function worked perfectly but I'd like to go a little further with the eye candy aspect if you (or anyone else) can help.

The problem; the field isn't shrinking on the printout and from what I can gather here, it has something to do with the JText function and using the TrimAll function as a fix.

I know the problem is within this field because when I removed it, everything else slid and shrunk perfectly.

Needless to say, the information contained in the link above is completely Greek Japanese to me. A sample of the printed field is attached.

As we would say down south, Thanky.

post-102845-0-06699600-1352050709_thumb.

Posted

If (not IsEmpty ( Mileage_Starting); "Starting Mileage: " & NumToJText ( Mileage_Starting;1;0 );"") & ¶ &

If (not IsEmpty ( Mileage_Ending); "Ending Mileage: " & NumToJText ( Mileage_Ending;1;0 );"") & ¶ &

If (not IsEmpty ( Mileage_Total ); "Total Miles: " & NumToJText ( Mileage_Total; 1; 0);"") & ¶ &

If (not IsEmpty ( EarnedToday );"Total Due: $" & NumToJText ( EarnedToday; 1; 0))

Posted

If ( not IsEmpty ( Mileage_Starting ) ; "Starting Mileage: " & NumToJText ( Mileage_Starting ; 1 ; 0 ) & ¶ ) &

If (not IsEmpty ( Mileage_Starting); "Starting Mileage: " & NumToJText ( Mileage_Starting;1;0 );"") & ¶ &

Can you spot the difference?

Posted

Yes, and thank you. I wasn't aware that you could close the parentheses outside the carriage return even though that is what you wrote in your earlier post. I guess you really can't get the full gist of a book by reading only half of each sentence, huh?

Posted

I wasn't aware that you could close the parentheses outside the carriage return

Why not? It's text, just like "Starting Mileage: ". To make it depend upon the test, include it inside the result of the If() function.

You can also use the List() function to achieve the same result:

List (

If ( not IsEmpty ( Mileage_Starting ) ; "Starting Mileage: " & NumToJText ( Mileage_Starting ; 1 ; 0 ) ) ;

If ( ... ) ;

If ( ... ) ;

...

)

  • Like 1

This topic is 4469 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.