Brian Dunning's FileMaker Custom Functions

AddComma ( number ; digits )

Put a comma in the specified number of digits.

  Average rating: 4.6 (25 votes) Log in to vote

fukky   fukky - Show more from this author

Share on Facebook Share on Twitter

  Sample input:
AddComma ( 1000 ; 3 )
  Sample output:
1,000

  Function definition: (Copy & paste into FileMaker's Edit Custom Function window)

number の指定した 桁数毎に カンマを付けて返す。
Put a comma in the specified number of digits.

 

Comments

Richard S. Russell   Richard S. Russell, Madison, Wisconsin, USA
May 17, 2017
You'll probably want to fiddle with this a bit to get commas only in the integer part of the number (to the left of the decimal point).
 
Richard S. Russell   Richard S. Russell, Madison, Wisconsin, USA
May 18, 2017
After posting the above comment about the decimal part of the number (not intended to have commas inserted in it), I decided to take a shot at it myself. Here's what I came up with (calling fukky's AddComma function to deal with the integral part of the number):

CommaCozzy

ANumber
DigitGroup

Let ( [
PureNumber = GetAsNumber ( ANumber );
IntegralPart = Int ( PureNumber );
DecimalPart = PureNumber - IntegralPart
] ;

AddComma ( IntegralPart; DigitGroup ) &
If ( DecimalPart > 0; GetAsText ( DecimalPart ); "" )

)
 
Claude Cyr   Claude Cyr, Personnal user
Dec 21, 2023
I am looking for a custom function to replace dots by commas. When I import data, it arrives with a dot and not a comma, which falsifies the values.
 

Log in to post comments.

 

Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.

Support this website.

This library has been a free commmunity resource for FileMaker users and developers for 20 years. It receives no funding and has no advertisements. If it has helped you out, I'd really appreciate it if you could contribute whatever you think it's worth: