cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Try the Materials Informatics Toolkit, which is designed to easily handle SMILES data. This and other helpful add-ins are available in the JMP® Marketplace
Choose Language Hide Translation Bar
chris_G_ttu
Level II

Data format help

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
Level X

Re: Data format help

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

View solution in original post

1 REPLY 1
ian_jmp
Level X

Re: Data format help

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