Hello, I have a question. We have a custom object where we have two fields (both of type text). Field 1 is read-only and in field 2 we can write a number according to a fixed format (validation rule). Now I want that the number from field 2 (the format is e.g. xx.xxx = so 20.234) is displayed in field 1 as number with 8 digits and without dot (20000234). That means between the 20 and the 234 three zeros should be added and the point should be removed for field 1. Do you have by chance a tip how I can implement this by formula? I've been sitting on it for a while now but I can't get any further. Thank you very much, Alex #Formulas #REGEX #Text Field
Forum Ambassador Eric Praud (Activ8 Solar Energies)
Slightly shorter (always a good idea to shorten formulas as much as possible):
IF(CONTAINS(Field2__c,"."),
LEFT(Field2__c,FIND(".",Field2__c)-1)+
LPAD(
MID(Field2__c,FIND(".",Field2__c)+1,255),9-LEN(LEFT(Field2__c,FIND(".",Field2__c))),"0"),
RPAD(Field2__c,8,"0"))