Bug report #9388
rpad doesn't work
|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|
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.
Ubuntu 13.10 64bit
#1 Updated by Tobias Schneider over 6 years ago
Also posted this here previously: http://gis.stackexchange.com/questions/83338/how-to-format-labels-with-leading-zeroes
#4 Updated by Tobias Schneider over 6 years ago
Nathan Woodrow wrote:
rpad('1',3,'0') || ' ' || lpad('1', 3, '0')give you?
This is my output in 2.0:
001 100and in master
I also get
and when I switch the commands to
lpad('1',3,'0') || ' ' || rpad('1', 3, '0')
Sorry I don't know what "in master" means.
#5 Updated by Tobias Schneider over 6 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.