Bug report #15636

Field calculator "lpad()" operator does not work

Added by Roy Roge about 8 years ago. Updated about 8 years ago.

Status:Closed
Priority:Severe/Regression
Assignee:-
Category:Field calculator
Affected QGIS version:2.14.6 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:23559

Description

Tested on a text field:

example:

1
2
3

lpad("fieldname", 2,'0')

expected result:

01
02
03

Thanks, Roy.
actual result:

1
2
3

History

#1 Updated by Nyall Dawson about 8 years ago

  • Status changed from Open to Feedback

I can't reproduce - are you sure you aren't storing the result in a numeric field?

#2 Updated by Roy Roge about 8 years ago

  • Status changed from Feedback to Closed

I'm quite sure because rpad was working properly,
anyway i cannot reproduce anymore and closing,
if i'll understand what was happening i'll reopen a new one,
thanks.

#3 Updated by Roy Roge about 8 years ago

Maybe I was actually using a numeric field,
that would explain why only rpad was working
(10, 20, 30 are indeed legit numbers), sorry for the mess.

Also available in: Atom PDF