cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
thunter Post Prodigy
Post Prodigy

Truncate Text

I have built an app that pulls available vacation hours for employees. However, in SQL table for 80 hours it is listed as 8000 and 120 hours is listed as 12000. I am trying to use LEFT truncate function to drop off the last 2 zeros but that doesn't work for both 8000 and 12000. If I do LEFT 2, I get 80 for the 8000 (which is correct) but only 12 for the 12000. Is there a way to truncate both numbers correctly int he same label? Thank you.truncate.png

2 ACCEPTED SOLUTIONS

Accepted Solutions
Super User
Super User

Re: Truncate Text

Try to combine the LEN and LEFT functions. Use LEN to first get the length of the string and then that length - 2 can be the parameter to the LEFT function.

Something like this:
Left(DeptTxt_2.Text, LEN(DeptTxt_2.Text)-2)

Let me know if this works. I am in front of my computer right now but believe this should work.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com

View solution in original post

Super User
Super User

Re: Truncate Text

Try
Left(DeptTxt_2.Text, Len(DeptTxt_2.Text)-2)

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com

View solution in original post

4 REPLIES 4
Super User
Super User

Re: Truncate Text

@thunter 

I think the way to go here is:

vacation_available/100

 

Your database is probably storing the values as integers with the 2 right-most digits for decimal places.

 

---
Please click "Accept as Solution" if my post answered your question so that others may find it more quickly. If you found this post helpful consider giving it a "Thumbs Up."

Super User
Super User

Re: Truncate Text

Try to combine the LEN and LEFT functions. Use LEN to first get the length of the string and then that length - 2 can be the parameter to the LEFT function.

Something like this:
Left(DeptTxt_2.Text, LEN(DeptTxt_2.Text)-2)

Let me know if this works. I am in front of my computer right now but believe this should work.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com

View solution in original post

thunter Post Prodigy
Post Prodigy

Re: Truncate Text

@PowerAddict 

 

I tried but got an error: Invocation of Unknown or Unsupported Function

truncate2.png

Super User
Super User

Re: Truncate Text

Try
Left(DeptTxt_2.Text, Len(DeptTxt_2.Text)-2)

Let me know if this helps.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution.

Thanks!
Hardit Bhatia
The Power Addict
https://thepoweraddict.com

View solution in original post

Helpful resources

Announcements
secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (7,053)