Jump to content

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

Recommended Posts

Posted

Just a simple question (I hope!). How do I right justify number fields so that in a list all the decimal points etc are lined up correctly?

Cheers

Nick

Posted

quote:

Originally posted by nelliott:

Just a simple question (I hope!). How do I right justify number fields so that in a list all the decimal points etc are lined up correctly?

Cheers

Nick

code:


Case( NUMBER < 0 , "-")

&

Choose( Abs( Round( NUMBER , PRECISION )) < 10^9 ,

Right( Abs(Int( Round( NUMBER , PRECISION ) / 10^9 )) , 3 ) & "," )

&

Choose( Abs( Round( NUMBER , PRECISION )) < 10^6 ,

Right( Abs(Int( Round( NUMBER , PRECISION ) / 10^6 )) , 3 ) & "," )

&

Choose( Abs( Round( NUMBER , PRECISION )) < 10^3 ,

Right( Abs(Int( Round( NUMBER , PRECISION ) / 10^3 )) , 3 ) & "," )

&

Right( Abs( Int( Round( NUMBER , PRECISION ))) , 3 )

&

Choose( PRECISION = 0 , "." &

Right( 10^PRECISION & Abs( Round( NUMBER , PRECISION ) )

* ( 10^PRECISION ) , PRECISION ))

In bold variables and the result is text.

Will deal with thousand's virgola too

Dj

HTH

[ April 09, 2002, 03:16 AM: Message edited by: dj ]

Posted

I think as long as your numbers are formatted to have the same number of digits after the decimal, and you select right alignment for the field format, everything will work. It's worth noting that even in proportionally spaced fonts, the digits 0..9 all have exactly the same width so that they will line up vertically in columns.

The only number alignment problem in Filemaker of which I'm aware occurs when numbers are formatted to show negative values in parentheses or with a trailing minus sign.

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