Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

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

Recommended Posts

Posted

i have a calculation field that displays the balances of some numbers. the criteria are as follows:

greater than 0: green

smaller than 0: red

equal to 0: blue

now, TextColor works perfectly. however, if you happen to use "Number format" on the field, for example, adding a leading "$" sign. the TextColor function will fail to work.

please try yourself and see if it so for you too. I am running on Windows 2003 enterprise server, Filemaker Developer 7v02.

should this be considered a bug?

but not being able to use the leading/trailing signs and number formats with TextColor is a great imperfection...

Posted

You can replace the field with a calculated text field to get the text color. I posted such a calculation about a month ago.

Case ( Balance > 0; TextColor ( If ( Position ( Balance ; "." ; 1 ; 1 ) ; Left ( Balance & "00"; Position ( Balance ; "." ; 1 ; 1 ) + 2) ; Left ( Balance & ".00"; Position ( Balance & ".00"; "." ; 1 ; 1 ) + 2 )) ; RGB ( 255 ; 0 ; 0 ) );

Balance < 0 ; TextColor ( If ( Position ( Balance ; "." ; 1 ; 1 ) ; Left ( Balance & "00"; Position ( Balance ; "." ; 1 ; 1 ) + 2) ; Left ( Balance & ".00"; Position ( Balance & ".00"; "." ; 1 ; 1 ) + 2 )) ; RGB ( 0 ; 255 ; 0 ) ) ;

TextColor ( If ( Position ( Balance ; "." ; 1 ; 1 ) ; Left ( Balance & "00"; Position ( Balance ; "." ; 1 ; 1 ) + 2) ; Left ( Balance & ".00"; Position ( Balance & ".00"; "." ; 1 ; 1 ) + 2 )) ; RGB ( 0 ; 0 ; 0 ) ) )

Adding $ signs requires a minor change.

Posted

GetAsnumber does not change the result. Definitely a bug. If number formatting negates text formatting then there should be a text formatting option to apply the number formats such as currency , percentage etc.

Posted

I misunderstood your post. It appears that "Number Format" wipes the calc'ed "TextColor()" formatting (or anything else too, it is an after the fact formatting). Too bad there isn't a "Currency()" function to add into the formatting mix.

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