Title: Round .5 or Integer
Last modified: November 17, 2018

---

# Round .5 or Integer

 *  Resolved [wpdia](https://wordpress.org/support/users/wpdia/)
 * (@wpdia)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/round-5-or-integer/)
 * How can I round Round to be .5 or Integer ?
    Small digits Demo as below: 1.) 
   5.15 to 5.5 2.) 5.4 to 5.5 3.) 4.45 to 4.5 4.) 9.6 to 10.0 5.) 7.7 to 8.0
 * if the digits are over 15 demo as below:
    1.) 15.1 to 16 2.) 18.7 to 19 3.) 18.4
   to 19 4.) 19.4 to 20
 * How can i do it? Thanks

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/round-5-or-integer/#post-10890236)
 * Hello [@wpdia](https://wordpress.org/support/users/wpdia/),
 * You simply should use the CEIL operation, passing to it the rounding factor as
   the second parameter:
 *     ```
       CEIL(fieldname1,0.5)
       ```
   
 * for example:
 *     ```
       CEIL(5.15, 0.5) = 5.5
       ```
   
 * But you want to use 0.5 as the rounding factor if the number is lesser than 15
   and 1 if it is greater than 15, so, the equation should be modified as follows:
 *     ```
       CEIL(fieldname1, IF(fieldname1<15, 0.5, 1))
       ```
   
 * and that’s all.
 * Note that I’m using fieldname1 only to describe the process, you should use the
   name of field, variable, number or operation you want.
 * Best regards.
 *  Thread Starter [wpdia](https://wordpress.org/support/users/wpdia/)
 * (@wpdia)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/round-5-or-integer/#post-10890750)
 * Thank you so much ! Resolved .
 *  Plugin Author [codepeople](https://wordpress.org/support/users/codepeople/)
 * (@codepeople)
 * [7 years, 6 months ago](https://wordpress.org/support/topic/round-5-or-integer/#post-10890836)
 * Hello [@wpdia](https://wordpress.org/support/users/wpdia/),
 * It has been a pleasure.
 * Best regards.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Round .5 or Integer’ is closed to new replies.

 * ![](https://ps.w.org/calculated-fields-form/assets/icon-256x256.jpg?rev=1734377)
 * [Calculated Fields Form](https://wordpress.org/plugins/calculated-fields-form/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/calculated-fields-form/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/calculated-fields-form/)
 * [Active Topics](https://wordpress.org/support/plugin/calculated-fields-form/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/calculated-fields-form/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/calculated-fields-form/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [codepeople](https://wordpress.org/support/users/codepeople/)
 * Last activity: [7 years, 6 months ago](https://wordpress.org/support/topic/round-5-or-integer/#post-10890836)
 * Status: resolved