Bug report #9388

rpad doesn't work

Added by Tobias Schneider almost 11 years ago. Updated almost 11 years ago.

Status:Closed
Priority:Normal
Assignee:-
Category:Labelling
Affected QGIS version:2.0.1 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:invalid
Crashes QGIS or corrupts data:No Copied to github as #:17986

Description

When I try to use the "rpad" function to label point features, it doesn't add any padding symbols. The function "lpad" works perfectly fine.

Setup:
Ubuntu 13.10 64bit
QGIS 2.0.1

QGIS_Screenshot_rpad.png (358 KB) Tobias Schneider, 2014-01-20 11:52 PM


Related issues

Related to QGIS Application - Bug report #9158: lpad() and rpad() functions do not work in standard way Closed 2013-12-03

History

#2 Updated by Giovanni Manghi almost 11 years ago

  • OS version deleted (13.10 64 bit)
  • Category set to Labelling
  • Target version set to Future Release - High Priority
  • Operating System deleted (Ubuntu)

#3 Updated by Nathan Woodrow almost 11 years ago

What does: rpad('1',3,'0') || ' ' || lpad('1', 3, '0') give you?

This is my output in 2.0: 001 100 and in master 100 001

#4 Updated by Tobias Schneider almost 11 years ago

Nathan Woodrow wrote:

What does: rpad('1',3,'0') || ' ' || lpad('1', 3, '0') give you?

This is my output in 2.0: 001 100 and in master 100 001

I also get 001 100

and when I switch the commands to lpad('1',3,'0') || ' ' || rpad('1', 3, '0')
I get 100 001

Sorry I don't know what "in master" means.

#5 Updated by Tobias Schneider almost 11 years ago

Ok now I feel like an idiot. I had "number formatting" switched on (because I thought it is a number). That is what took away the leading zeros. I switched the number formatting of and now lpad and rpad work. Using lpad('1',3,'0') || ' ' || rpad('1', 3, '0') probably did an override on the number formatting and that why that worked fine.

#6 Updated by Nathan Woodrow almost 11 years ago

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

Also available in: Atom PDF