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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Having issues with Con...
Power Automate
Unanswered

Having issues with Converting String to float or integer with Power Automate

(0) ShareShare
ReportReport
Posted on by 69

I'm having error or not expected result when I do have, with the following expression. 

I have a String with '10,50' which is equivalent to '10.50'. But whatever writing with comma or point, this ends with the same error. 

  1. int('10,50') -> 1050
  2. float('10,50')-> 1050
  3. Sub( ofloat, ofint) -> fails

 

  1. int('10.50') -> error "InvalidTemplate. Unable to process template language expressions in action 'Integer_part' inputs at line '0' and column '0': 'The template language function 'int' was invoked with a parameter that is not valid. The value cannot be converted to the target type.'.
  2. float('10.50'): ActionConditionFailed. The execution of template action 'float' is skipped: the 'runAfter' condition for action 'Integer_part' is not satisfied. Expected status values 'Succeeded' and actual value 'Failed'.

 

In conclusion, I suppose '10.50' is better than '10,50' to write a decimal number, howerver it fails also miserably. Of course I added a compose action to replace ',' by '.' but it didn't fix neither. 

 

So, would it ring you any idea that I could test ? Thank you in advance for your reading. 

 

At the end of the day I was trying to addToTime with decimal number of year, this is the reason I have to split int and frac part. 

Categories:
I have the same question (0)
  • manuelstgomes Profile Picture
    6,625 on at

    Hi @Tristan21 

     

    You need the period instead of the comma to convert to a float. This will work:

    float('10.50'
     
    Screenshot 2022-02-25 at 17.14.47.png
     
    The second error is not related to the function itself but with something else. can you please share your Flow with those errors so that I can look?
     
    Cheers
    Manuel

    ------------------------------------------------------------------
    If I have answered your question, please mark it as "Accept as Solution." It will help other members finding the solution faster. If you like my response, please give it a Thumbs Up. ?
    Otherwise, reply to it, and the community will do its best to help you.
  • Tristan21 Profile Picture
    69 on at

    Hello Manuel, 

    Firstly, thank you for your reading and feedback. I've meanwhile opened a support request about it , ... still in process. 

    Just to clarify my initial need:  Split the int part and frac part of decimal number that I receive in string "10,50" (-> get the 10 and get the 0,50.).

    In the 80's that was Int(number) and Frac(number) functions available on Ti57 programmable calculator 😉 quite simple at that old time ).


    It's possible that I'm having regional settings conflict between french/English (, or .). I say so because int(1.5) isn't working neither. 

    However the Solution /workaround I see now is making the split my self at the string level like ;

    IntPart= ( int(first(split(StringNumber, ','))) ;

    FracPart=mul(int(last(split(StringNumber,','))),10)
    That'll make for now
    Tristan21_0-1645814500099.png

     

     

  • Verified answer
    Tristan21 Profile Picture
    69 on at

    After few attempts, here is the solution I came with regarding how to extract respectively Int and Frac part from  decimal number. I miss understood the Int function, it's not aim to provide Int part but to transform whole number as string into whole number( int('10')=10. Same for float, ... decimal number as string into decimal number float('10.5')=10.5. Once said it seems obvious 😉  

    So the key function is formatNumber, which allows to limit the number expression into a whole number: formatNumber( 10.5 , '0')=10. 

    The frac of 10.5 = 0.5= float('10.5')-formatNumber(float('10.5'),'0')

  • arcado Profile Picture
    320 Moderator on at

    I have a problem as I am reeding excel cell it says for ex 10.57 power automate gives me 1,057 as float how can I fix that?

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard