Skip to content

bluebones.net

Adventures in Computer Programming – bakert@gmail.com

Month: April 2006

Posted on April 4, 2006June 5, 2008

Rounding in Javascript

function round(num, decimalPlaces) {
   n = Math.pow(10, decimalPlaces);
   return Math.round(num * n) / n;
}

Recent Posts

  • Are your Fellow Human Beings your Comrades?
  • muted, accent and secondary are all the same color in default shadcn/ui themes
  • Running a dozen Next.js devservers without losing your mind
  • Rebase a whole stack at once
  • shadcn/ui v3/v4 and –destructive theme variables
  • Psychopathic Git Shortcuts
  • Sort committers by average length of commit message
  • Gradient Borders with Transparent Background
  • How to keep your input and dismiss/cancel atuin
  • Starting more than one dev webserver each in its own terminal window (Mac)
Proudly powered by WordPress