• cluebcke
  • NEWBIE
  • 0 Points
  • Member since 2008

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 1
    Replies
I see the the Apex Math.round() function is being deprecated in favor of Math.roundToLong().

It looks like we now have to use the following code to convert a number field value from double to integer for use in functions that require integer parms (e.g. Date.newInstance(year,month,day))

Integer intValue = Integer.valueOf(String.valueOf(Math.roundToLong(object.Some_Number_Field__c)));

Are there plans to allow casting or conversion from Long to Integer in Apex?  Or at least, is there an easier way to achieve the same result than the example above?

Thanks,