Loading

How to Fill in Leading Zeros to a String

Дата публикации: Apr 13, 2024
Задача

How to fill in the leading zero to a string.

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

Действия
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)


 
Дополнительные ресурсы

String Functions

Номер статьи базы знаний

001458386

 
Загрузка
Salesforce Help | Article