June 28, 201015 yr G'morning, all: I always flub the calculation for inserting a thousands separator in a text/number calculation. (Hey, at least I'm consistent--the hallmark of a good developer. How do I code the calc for this so the character count below has a comma in it? Case (IsEmpty(jobs__cover_letter); "0"; "(" & Length(jobs__cover_letter)) & " characters)" TIA for your help!
June 28, 201015 yr Hi, what you want to do is basically looking at the number as a string of digits, than beginning from the right end, take three digit, put a comma in front, then take the next bunch of max. three digits and so on. This might need some checking of boundaries, like number less than 1000 etc. To get you started have a look at Brian Dunnings collection of calculation algorithms at http://www.briandunning.com/filemaker-custom-functions/recentlist.php search for "number formatting". If the only place where you need this is the layout, you could also FM built in formatting. Put a merge-field into a text on the layout, like " <> characters." and choose the appropriate number format for that object. Volker
June 28, 201015 yr I'm not sure I'm understanding your need. Can you be more specific as to what is in the field(s) now and what you want the end results to be? Lee
June 28, 201015 yr I always flub the calculation for inserting a thousands separator in a text/number calculation. This post gave you the answer... did you forget it ? Case ( IsEmpty(jobs__cover_letter); 0 ; "(" & NumToJText ( Length ( jobs__cover_letter ) ; 1 ; 0 ) & " characters)" )
June 3, 201510 yr Why did you make this post? it’s over 5 years old, and it refers to a topic that is not available.
Create an account or sign in to comment