cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
thunter
Level 8

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

Highlighted
thunter
Level 8

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
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,187)