Bug report #9388
rpad doesn't work
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
Related issues
History
#1 Updated by Tobias Schneider almost 11 years ago
Also posted this here previously: http://gis.stackexchange.com/questions/83338/how-to-format-labels-with-leading-zeroes
#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 master100 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
- File QGIS_Screenshot_rpad.png added
- % Done changed from 0 to 100
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