cancel
Showing results for
Did you mean:
Helper III

## How to clear number "0" in email notification?

Hi All,

When i get the number from column in SharePoint List to Send email with option and there are many number "0" at email notification so do you know how to remove it?

if i put number by manual is OK, the number from Formula it will like that.

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Resolver III

hello @NguyenHuu ,

I built up the whole pipeline for you. Here it is (kudoe and solution wanted :P):

I used exactly your formula for the "Total day leave" and got only 1 decimal place after the dot.

Then in the flow:

my expression to calculate is:

``float(concat(split(triggerOutputs()?['body/Total_x0020_day_x0020_leave'],'.')[0],'.',substring(split(triggerOutputs()?['body/Total_x0020_day_x0020_leave'],'.')[1],0,1)))``

And it works like charm

With regards

Kevin

11 REPLIES 11
Resolver III

Hello @NguyenHuu

its pretty easy. use the expression int() and wrap your sharepoint output into it. So int(total day leave) inside your mail body should fit it.

With regards

Kevin

Helper III

Thanks @powercorner ,

But it can't show the  half day like 0.5 to 0 or 1.5 to 1

Thanks.

Resolver III

then you can do some math:

div(float(int(mul(YOURFLOAT,10))),10)

that is

take YOURFLOAT

multiple by 10

converting to int

converting to float (else it became an integer result)

dividing by 10

Helper III

Hi @powercorner ,

div(float(int(mul(triggerOutputs()?['body/Total_x0020_day_x0020_leave'],10))),10)

and it got problem like this:

Resolver III

Hmm okay then try a different approach with strings. Try this: (the expressions are in the comments)

What I basically do is:

- I split the float at the dot

- take the front as it is

- get the first letter from the back of the float

- make it to a string again:

concat(split(string(variables('FloatNumber')),'.')[0],'.',substring(split(string(variables('FloatNumber')),'.')[1],0,1))

Helper III

Hi @powercorner ,

and get the error:

Resolver III

I assumed you have a number coming from the SharePoint but its a string. so you can leave out the float variable initialization: begin with the splitting cause you already have a string.

concat(split(YOURSPVALUE,'.')[0],'.',substring(split(YOURSPVALUE,'.')[1],0,1))

btw why did you save a number of days in a string in the SP column? That sounds not good.

With regards

Kevin

Helper III

Hi @powercorner ,

The number from Formula : =IF(Halfday=TRUE,((DATEDIF(StartDate,EndDate,"D"))-INT(DATEDIF(StartDate,EndDate,"D")/7)*2-IF(WEEKDAY(EndDate)<WEEKDAY(StartDate),2,IF(OR(WEEKDAY(EndDate)=7,WEEKDAY(StartDate)=1),1,0))+1)-0.5,((DATEDIF(StartDate,EndDate,"D"))-INT(DATEDIF(StartDate,EndDate,"D")/7)*2-IF(WEEKDAY(EndDate)<WEEKDAY(StartDate),2,IF(OR(WEEKDAY(EndDate)=7,WEEKDAY(StartDate)=1),1,0))+1))

so can you share me detail how to fix it?

Thanks

Resolver III

hello @NguyenHuu ,

I built up the whole pipeline for you. Here it is (kudoe and solution wanted :P):

I used exactly your formula for the "Total day leave" and got only 1 decimal place after the dot.

Then in the flow:

my expression to calculate is:

``float(concat(split(triggerOutputs()?['body/Total_x0020_day_x0020_leave'],'.')[0],'.',substring(split(triggerOutputs()?['body/Total_x0020_day_x0020_leave'],'.')[1],0,1)))``

And it works like charm

With regards

Kevin

Helper III

Thank so much @powercorner ,

it work 🙂

Thanks.

Huu.

Helper III

Hi @powercorner ,

Do you know how to change format of date to DD-MM-YYYY?

Thanks

Announcements

Check out the new Process Advisor community forum board!

#### Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

#### 2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (3,024)