Hacktoberfest 2026: as issues que os mantenedores marcaram para outubro, abertas e boas para iniciantes. Ver issues do Hacktoberfest

nf() function description inadequate

Aberta
#353 0 comentários 0 reações 0 responsáveis Ver no GitHub

Mantenedores costumam responder em até 1 dia

Ninguém assumiu esta issue ainda.

Avaliação

Dificuldade
2/5
Tempo estimado
1-3 horas
Facilidade para iniciantes
55/100
Tipo de issue
Documentação
Clareza
Claramente especificada
Status de atividade
Estagnada
Domínio
documentation

Direção de pesquisa

Abra a página de referência afetada de nf() em processing.org/reference/nf_.html e revise sua descrição atual e as seções Syntax e Parameter. Esclareça as diferentes formas de chamada e os parâmetros obrigatórios para entradas do tipo float e array. O trabalho estará concluído quando uma pessoa iniciante conseguir identificar qual assinatura se aplica a cada tipo de entrada.

Escrita pelo modelo de indexação a partir do texto da issue.

Descrição

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

Linguagem predominante
MDX
Estrelas
90
Forks
122
Merge médio
1h 20min
PRs com merge (30d)
4

Preparar o ambiente

Ainda não verificamos os arquivos de configuração deste projeto. Comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.

Primeiros passos

  1. Leia a issue inteira e depois o guia de contribuição do projeto.
  2. Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
  3. Faça um fork do repositório e trabalhe em uma branch.
  4. Abra um pull request que referencie o número da issue.

Mais de processing/processing-website

Todas as issues de processing/processing-website

Issues semelhantes

Mais issues de Documentation

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.