processing / processing/processing-website

nf() function description inadequate

Abierto
#353 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Lenguaje dominante
MDX
Estrellas
90
Forks
122
Merge medio
1 h 43 min
PR fusionados (30 d)
3

Descripción

Issue description

nf() function reference could use a better description. As of now the text says:

Utility function for formatting numbers into strings. There are two versions: one for formatting floats, and one for formatting ints. The values for the digits and right parameters should always be positive integers. The left parameter should be positive or 0. If it is zero, only the right side is formatted.

This text only states that an int and a float version is existent. Nowhere is it explained how those are different. Referring to this description a call like nf(float, int) would be valid. This call however is not functional as passing num as a float variable requires to specify a left and right parameter (so the call has to be nf(float, int, int)).

This could be confusing to beginner programmers.

URL(s) of affected page(s)

https://processing.org/reference/nf_.html

Proposed fix

In my opinion ideally, in line with single responsibility, these would be two functions.

However an extended description should also do the trick.
The text could be extended by a paragraph similar to:

When num is a variable of type float the call becomes nf(num, left, right). left represents the formatted number left of the decimal point and right represents the formatting right of the decimal point.

Alternatively it could be made clear in the Syntax and Parameter section which call allows which parameters.

nf(numf, left, right)
nf(numsf, left, right)

numf = float: the number to format
numsf = float[]: the numbers to format

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Abre la página de referencia de nf() afectada en processing.org/reference/nf_.html y revisa su descripción actual y las secciones Syntax y Parameter. Aclara las distintas formas de llamada y los parámetros requeridos para las entradas de tipo float y array. El trabajo estará terminado cuando un principiante pueda saber qué firma corresponde a cada tipo de entrada.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Área
documentation
Tipo de issue
Documentación
Dificultad
2/5
Tiempo estimado
1-3 horas
Estado de actividad
Estancado
Claridad
Bien especificado
Aptitud para principiantes
55/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.