Loading

How to Fill in Leading Zeros to a String

Publiceringsdatum: Apr 13, 2024
Uppgift

How to fill in the leading zero to a string.

For example:
A       -> 000A
AB    -> 00AB
ABC -> 0ABC

Steg
1. Create a calculation field named "OriginalData(Edited)" to add a zeros string of  N digits to head of the original string. ( N = the final length of the string)
 Calculation formula: "0000"+STR([OriginalData])

2. Create a calculation field to trim the right N digits of  [OriginalData(Edited)]
 Calculation formula: RIGHT( [OriginalData(Edited)],4)


 
Ytterligare resurser

String Functions

Knowledge-artikelnummer

001458386

 
Laddar
Salesforce Help | Article