Tag Archives: float

Kotlin: Number Type and Range


Warning: Parameter 2 to qtranxf_postsFilter() expected to be a reference, value given in /home/and-beyond/www/main/wp-includes/class-wp-hook.php on line 286

I summarized Kotlin basic number types and their range. In Kotlin, we can use Byte, Short, Int, Long, and UByte, UShort, UInt, ULong.

Continue reading Kotlin: Number Type and Range

Ruby: Round Down with some decimal places


Warning: Parameter 2 to qtranxf_postsFilter() expected to be a reference, value given in /home/and-beyond/www/main/wp-includes/class-wp-hook.php on line 286

Warning: Parameter 2 to qtranxf_postsFilter() expected to be a reference, value given in /home/and-beyond/www/main/wp-includes/class-wp-hook.php on line 286

Warning: Parameter 2 to qtranxf_postsFilter() expected to be a reference, value given in /home/and-beyond/www/main/wp-includes/class-wp-hook.php on line 286

Warning: Parameter 2 to qtranxf_postsFilter() expected to be a reference, value given in /home/and-beyond/www/main/wp-includes/class-wp-hook.php on line 286

Memorized the way to round down number to the nth decimal places in Ruby.

The number like 0.81235 (Float) has function floor, which round down the number to zeal number, can’t round down to some decimal places.

Environment

  • Ruby 2.2.3p173
  • OS: Ubuntu 15.04
Continue reading Ruby: Round Down with some decimal places