Subscribe Bookmark RSS Feed

Data format help

chris_G_ttu

New Contributor

Joined:

Sep 13, 2017

Hi

I am trying to round a number but having some trouble. For example. I have the number .915 and .915000021 I have tried to use percision and Fixed Dec to round .915000021 to .915. However, after I use precision or Fixed Dec the .915000021is unchanged. Any ideas how I can change this? Also there is multiple instances like this, so editing the column would be the best solution for me.

 

Could I copy the column and use a formula to round everything then paste it and delete the orginal column?

any advise would be appreiaceted.

Capture.PNG

Capture 2.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
ian_jmp

Staff

Joined:

Jun 23, 2011

Solution

JMP Numeric Formats change the way data appears, but not the underlying value. Probably you need the 'Round()' function, but as always, you should be cautious in modifying the data values themselves. Copy and paste the code below into a script window, do 'Edit > Run Script', then look at the formula columns:

New Table( "Formats and Rounding",
	Add Rows( 10 ),
	New Column( "Precise Value",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Formula( Random Normal() )
	),
	New Column( "Precise Value with 'Fixed Dec' Format",
		Numeric,
		"Continuous",
		Format( "Fixed Dec", 12, 2 ),
		Formula( :Precise Value )
	),
	New Column( "Precise Value with 'Precision' Format",
		Numeric,
		"Continuous",
		Format( "Precision", 12, 2 ),
		Formula( :Precise Value )
	),
	New Column( "Precise Value Rounded to 2 Decimal Places",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Formula( Round( :Precise Value, 2 ) )
	)
)
1 REPLY
ian_jmp

Staff

Joined:

Jun 23, 2011

Solution

JMP Numeric Formats change the way data appears, but not the underlying value. Probably you need the 'Round()' function, but as always, you should be cautious in modifying the data values themselves. Copy and paste the code below into a script window, do 'Edit > Run Script', then look at the formula columns:

New Table( "Formats and Rounding",
	Add Rows( 10 ),
	New Column( "Precise Value",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Formula( Random Normal() )
	),
	New Column( "Precise Value with 'Fixed Dec' Format",
		Numeric,
		"Continuous",
		Format( "Fixed Dec", 12, 2 ),
		Formula( :Precise Value )
	),
	New Column( "Precise Value with 'Precision' Format",
		Numeric,
		"Continuous",
		Format( "Precision", 12, 2 ),
		Formula( :Precise Value )
	),
	New Column( "Precise Value Rounded to 2 Decimal Places",
		Numeric,
		"Continuous",
		Format( "Best", 12 ),
		Formula( Round( :Precise Value, 2 ) )
	)
)