TMvK
  • Home

round

A collection of 2 posts

toFixed

Quickie: JavaScript decimal multiplication

Another oddity of JavaScript I found. Multiplying decimal numbers can be tricky (or malicious?). Order of numbers can matter in multiplication. // order #1 135*1.15*10.5 // = 1630.125 // order #2 1.

TvK
javascript

Quickie: round()

Once again, different programming languages give different results. Now let's focus on rounding negative numbers. Python + PHP print(round(-1.5)) # -2 print(round(1.5)) # 2 echo round(-1.5) // -2 echo

TvK
TMvK © 2025
Latest Posts Ghost