function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
benwrigleybenwrigley 

Integer, Double or Decimal?

Apologies as I'm sure this must be a stupid question but I'm clearly missing something!

 

I've create a field through the UI called Quantity and set it as a number with 0 decimal places.

 

I want to test if this is a factor of another number I have.

 

The schema browser says that the DB defines this field as a Double and not an int. OK, slightly annoying but I'll convert it integer x  = double.intValue(Quantity__c). 

 

Force.com complains that there is no method intValue that accepts a Decimal!

 

So what have I created, an integer, a double or a decimal? Is there a way to create an Integer field in the UI?

 

TIA

MarceldeBMarceldeB

The UI always creates a decimal, sou you could use decimal.intvalue(quantity__c)

Bing@putBing@put

Thanks MarceldeB.  helped me today!