Skip to Main Content

APEX

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Is it necessary to convert a field type number to number for doing calculations ?

Hi,

Under Oracle APEX 24.2.14, I have a computation on a form type Expression and I am doing conversion for fields type number to number with the TO_NUMBER function:

select (
          (:p10_tarif * (:p10_nombre_adultes + :p10_nombre_enfants)) +
          ((to_date(:p10_date_fin_reservation, 'dd/mm/yyyy') - to_date(:p10_date_reservation, 'dd/mm/yyyy')) *
           (to_number(:p10_vehicule) * nvl(to_number(:p10_nombre_vehicules), 1))) +
          ((to_date(:p10_date_fin_reservation, 'dd/mm/yyyy') - to_date(:p10_date_reservation, 'dd/mm/yyyy')) * nvl(TO_NUMBER(:p10_electricite), 0)) +
          :p10_don
      ) as total_tarif
 from dual;

Is it necessary to do so or can i leave the field as it is without converting it ?

Best regards.

This post has been answered by fac586 on Mar 29 2026
Jump to Answer
Comments
Post Details
Added 2 days ago
2 comments
95 views