Hi, I'm exporting a group of a decimal fields to txt and I'm getting those fields with leading zeros: 000000246 and the result I pretend is 246.I did this funtion below and tried the same function with the parameters on DELCHAR and it didnt work.Any tip?
DecimalNumeralZeroFormat(Amount,9) //Respective Function LOCAL DecimalNumeralZeroFormat(DecimalNumeral : Decimal;Length : Integer) : Text[250] EXIT(TextZeroFormat(DELCHR(FORMAT(ROUND(ABS(DecimalNumeral),1,'<'),0,1)),Length));
*This post is locked for comments
What code do you have in TextZeroFormat function?
LOCAL TextZeroFormat(Text : Text[250];Length : Integer) : Text[250] IF STRLEN(Text) > Length THEN ERROR(Text003,Text,Length); EXIT(PADSTR('',Length - STRLEN(Text),'0') + Text);
I am unsure whether I got the point ...
What is your desired output, and what are you getting instead?
TextZeroFormat function is adding the leading zeros.
Please try to change your code by removing above function
Then replace the function call with FORMAT(Amount);
hi,
follow msdn.microsoft.com/.../dd354973.aspx for delchr function
and http://msdn.microsoft.com/en-us/library/dd301101.aspx for padstr function.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Abhilash Warrier as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Saurav.Dhyani 2 Super User 2025 Season 2
RK-25090803-0 1