Feature request #5214

field-calculator: a new function to fill a string of repeated chars

Added by aperi2007 - over 12 years ago. Updated about 12 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:-
Pull Request or Patch supplied:No Resolution:fixed
Easy fix?:No Copied to github as #:14950

Description

Hi,
in the field-calculator to fill a field of the attribute-table,
should be really useful a function like the
"repeat(S text,N integer)"
to produce a new string with N times the string S,
like as exmaple:

repeat("0", 10) ==> "0000000000"

This is really useful to produce a code-block using it with the "length" functin.

as this example:

= repeat("0",10-length($rec)) || field($rec)

this will produce a code-block like this:

0000000001
0000000002
0000000003
0000000004
0000000005
...
0000000009
0000000010
0000000011

History

#1 Updated by Giovanni Manghi over 12 years ago

  • Target version set to Version 2.0.0

#2 Updated by Paolo Cavallini about 12 years ago

  • Resolution set to fixed
  • Status changed from Open to Closed

This should have been fixed. Please reopen if necessary.

Also available in: Atom PDF