Skip to content

Instantly share code, notes, and snippets.

@parzibyte
Created March 15, 2021 03:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save parzibyte/8e5bb7a1c08e8452457619f331cb31d9 to your computer and use it in GitHub Desktop.
Save parzibyte/8e5bb7a1c08e8452457619f331cb31d9 to your computer and use it in GitHub Desktop.
función redondear(numero) {
// .5 o menos, baja. Si no, sube
diferencia = numero - redondearHaciaAbajo(numero);
if (diferencia <= 0.5) {
return redondearHaciaAbajo(numero);
} else {
return redondearHaciaArriba(numero);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment