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 Automate / Converting a string wi...
Power Automate
Answered

Converting a string with a decimal point to an integer

(0) ShareShare
ReportReport
Posted on by 8
Hello!
 
I am building a flow based on a form response. One of the fields in the form is a number value that will contain decimal points. For example, 100.01. I am trying to add a condition that if the value is over 100, then it will proceed. There are no symbols in the response apart from the decimal point, and no letters.
 
The problem - it is not registering it as an integer. I have tried a few things to get it to convert, none have worked. 
 
This is what I have tried, all in an operation action - 
  • formatNumber(int(MYINPUT))
  • formatNumber(int(MYINPUT),'0')
  • int(formatNumber(MYINPUT))
  • the above, but separated in 2 different operation actions.
 
Each time I am getting an error that it is expecting a integer value and getting a string. 
Categories:
I have the same question (0)
  • Suggested answer
    Kalathiya Profile Picture
    1,802 Super User 2026 Season 1 on at

    You can fix this by converting the string to a number before comparing it.

    Expression: 
    formatNumber(coalesce(float(variables('number')), 0), '000.00')
    
    
    //variables('number') - replace this with your variable or dynamic content field
    Coalesce() is used because if the value is empty or null, the flow would normally fail. coalesce() makes it default to 0 instead, so the flow keeps running without errors.
     
     
    If this response resolves your issue, please mark it as the Verified Answer so it can help other community members as well.
    ---------------------------------------------------------------------------------
     
    📩 Need more help? Mention @Kalathiya anytime!
    ✔️ Don’t forget to Accept as Solution if this guidance worked for you.
    💛 Your Like motivates me to keep helping!
  • CU25021545-0 Profile Picture
    8 on at
    Thank you! @Kalathiya 
     
    I added that, and the function itself succeeded, but moving on to the next steps it fails again.
     
    Action 'Condition' failed: Unable to process template language expressions for action 'Condition' at line '0' and column '0': 'The template language function 'greaterOrEquals' expects two parameter of matching types. The function was invoked with values of type 'String' and 'Integer' that do not match.'.
     
     
  • David_MA Profile Picture
    14,278 Super User 2026 Season 1 on at
    If the above is not what you were looking for, you can try this expression:
     
    int(first(split(variables('DecimalString'), '.')))
     
    Note, this assumes your string always contains a decimal point in it. If not, this gets more complicated.
     
     
    There are potential issues with this if the string:
    • contains more than one decimal
    • does not contain a decimal
    • is null
    • contains anything but numbers and the decimal
    • or has leading white space, which is easily fixable by wrapping the string in a trim() expression
  • CU25021545-0 Profile Picture
    8 on at
    @David, unfortunately I can't guarantee if it will always have decimal points.
     
    on the form itself, it is a required number field. So no extra values can be accepted, but the value sometime is a whole number.
  • CU30121719-0 Profile Picture
    156 on at
    int(first(split(concat(variables('DecimalString'),'.'), '.')))
  • Verified answer
    Kalathiya Profile Picture
    1,802 Super User 2026 Season 1 on at
      
    Please try below expression. 
    float(first(split(string(coalesce(variables('number'), '0.00')), '.')))
     
     
    If this response resolves your issue, please mark it as the Verified Answer so it can help other community members as well.
  • CU25021545-0 Profile Picture
    8 on at
     
    Same thing on this one, that itself turns out successful, but then working in with the condition it is not successful.
     
    Test value from form was 693.33 for context. This is the output for your formula. I am on browser, so when I select show raw outputs/inputs it just shows me the same value as in the screenshot below. no additional information on if it is a string or integer. 
     
     
    Then moving on to the condition, it fails.
     
     
    UPDATE AFTER POSTING THIS COMMENT: it just needed time to correct itself. This has been answered and i will mark the answer. thank you!!!
     
     
  • Suggested answer
    VGKolar Profile Picture
    51 on at

    The error happens because int() in Power Automate only works on whole numbers. If your form field contains decimals like 100.01, int() will fail since it expects a clean integer string.


    Use float() instead of int(). float() can handle numbers with decimal points and lets you compare them directly. For example, in your condition use.

    @greater(float(triggerOutputs()?['body/numberField']), 100)
    This will correctly evaluate whether the number is greater than 100, even if it has decimals.

    • Use float() for numeric inputs with decimals.

    • Only use int() if you specifically need to drop the decimal part.

  • David_MA Profile Picture
    14,278 Super User 2026 Season 1 on at
    If I am following along and understand the screen shots, in your condition wrap the output of the Compose action in an int() expression.
     
    The compose action returns a string ("693") and your expression checks numbers. By using the int() expression, it will return a number (693) not wrapped in quote marks.

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 Automate

#1
Haque Profile Picture

Haque 607

#2
Valantis Profile Picture

Valantis 495

#3
Vish WR Profile Picture

Vish WR 429

Last 30 days Overall leaderboard