Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

BUG with TextColor()

Featured Replies

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

Have you tried adding in the GetAsNumber() function?

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.

  • Author

i see~ thanks...

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.

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.

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.