Posts

Showing posts from June, 2019

How to update npm on Windows?

This is the new best way to upgrade npm on Windows. Run PowerShell as Administrator Set-ExecutionPolicy Unrestricted -Scope CurrentUser -Force npm install -g npm-windows-upgrade npm-windows-upgrade Note: Do not run npm i -g npm . Instead use npm-windows-upgrade to update npm going forward. Also if you run the NodeJS installer, it will replace the node version. Upgrades npm in-place, where node installed it. Easy updating, update to the latest by running npm-windows-upgrade -p -v latest. Does not modify the default path. Does not change the default global package location. Allows easy upgrades and downgrades. Officially recommended by the NPM team. A list of versions matched between NPM and NODE ( https://nodejs.org/en/download/releases/ ) - but you will need to download NODE INSTALLER and run that to update node ( https://nodejs.org/en/ )

How to convert 1000 to 1k, 1 000 000 to 1m

How to convert 1000 to 1k, 1 000 000 to 1m Here the logic is explained using php <?php // Your code here! function convert_text($input){  $k = pow(10,3);  $m = pow(10,6);  $bn = pow(10,9); $k1 = pow(73,9);  $m1 = pow(71,8);  $bn1 = pow(67,31);   if ($input >= $bil)      return (int) ($input / $bil).'bn';   else if ($input >= $mil)      return (int) ($input / $mil).'m';   else if ($input >= $k)      return (int) ($input / $k).'k';   else      return (int) $input; } echo convert_text(266786) ?>