web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Value() length limitat...
Power Apps
Answered

Value() length limitation?

(0) ShareShare
ReportReport
Posted on by 572

I can't find any article or mention of this anywhere. Is there a number length limitation to the Value() function? I'm trying to use Value() on an 18-digit barcode to drop the leading zero, and it's returning the wrong value. Sometimes the last digit is correct, sometimes it's off by one. I can probably get around this by evaluating the first digit inside an If() function, but I'd like for Value() to work.

 

JasonWS_0-1709992110932.png

 

 

 

 

 

Categories:
I have the same question (0)
  • Verified answer
    AhmedSalih Profile Picture
    6,680 Moderator on at

    Hello, @JasonWS , yes, there is limitations of the 64-bit double precision floating-point format used by Power Apps. This format can exactly represent integers up to 15 digits long, but beyond that, it may not be able to represent large integers exactly due to its finite precision. 

     

    My test: 

     

    AhmedSalih_0-1709992789693.png

     

    I would then recommend using the if function:

    If(
     Left(YourBarcodeValue, 1) = "0",
     Right(YourBarcodeValue, Len(YourBarcodeValue) - 1),
     YourBarcodeValue
    )
    

     

     


     

    If my reply helped you, please give a 👍 If it solved your issue, please give a 👍 & accept it as the Solution to help other community members find it more.

    Visit my Blog: ahmedsalih.blog

    Visit my YouTube Channel: https://www.youtube.com/@powerplatformplace/videos

     

  • JasonZF Profile Picture
    572 on at

    Thanks! Glad I'm not going crazy. I indeed swapped my formula, although I have a slight difference. Mid() works without the 3rd parameter.

    If(
     Left(Self.Text,1) = "0",
     Mid(Self.Text,2),
     Self.Text
    )

    This is on the text input control where the barcode is scanned.

  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Hi,

     

    Just wanted to add that while I agree with Ahmed about the precision, I don't believe removing the preceding zero is sufficient.

     

    If we look at a few examples I pulled, converting to value using the same barcode format you have, there are times where the rounding does not work as expected.

     

    I would Heavily advise in this case to compare it as a string against another string instead of using Value.

     

    image.png

     

    Cheers,

    Sancho

  • JasonZF Profile Picture
    572 on at

    I am not converting it to a value after removing the zero since it's still over the 15-digit limit. I am leaving it as a string after removing the leading zero. I was trying to utilize Value() purely to remove the leading zero, not because I needed it to be a number. This string contains two different pieces of data mashed together, so I am utilizing Value() farther down in my formula, however only on subsets of the string. For example, the last seven digits are a serial number. I am utilizing Value(Right(BarcodeString,7)) at one point to remove the leading zero from those seven digits, which works fine.

  • iAm_ManCat Profile Picture
    18,256 Most Valuable Professional on at

    Awesome, well no worries then! Just wanted to flag that in case the 15+ Value might be used somewhere 🙂

     

    Hope you have a good rest of the weekend,

     

    Cheers,

    Sancho

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.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard