make object() function take decimal or int