Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3787992
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:55:42+00:00 2026-05-19T11:55:42+00:00

How can I cause numbers with no value to show up blank instead of

  • 0

How can I cause numbers with no value to show up blank instead of NaN on forms?

Let’s say I have a User class with an optional weight (kgs) value, of type Number. If I edit a User in Flex I get the user object from the server and bind weightInput.text to user.weight. If weight is null on the server it will be translated to NaN in Flex, and then the value of weight in the edit form showes up as NaN. That is really inconvenient, as I would like it to just be blank if it has no value.

Is there a recommended/simple way to handle this? I would have thought that it is a really common problem.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T11:55:42+00:00Added an answer on May 19, 2026 at 11:55 am

    One way is to use the NumberFormatter:

    <fx:Declarations>   
        <mx:NumberFormatter id="numeric" />
    </fx:Declarations>
    
    <s:Label text="number is {numeric.format(myNumber)}" />
    

    Or, if you don’t want to use a formatter, you can use isNaN():

    <s:Label text="number is {isNaN(myNumber) ? '' : myNumber}" />
    

    Good lucks 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created an excel worksheet in a such way that the user can
Let's say you have two collections of integers: IEnumerable<int> col1=new List<int> {2,3,3,5,7,11,11,11,13}; IEnumerable<int> col2=new
I read that MySQL fulltext search can cause table locking . It means people
I'm not sure if the following code can cause redundant calculations, or is it
I am not good at jsp but I wondered what can cause such a
In a binary search implementation, obviously: mid = (low + high)/2 can cause overflow.
Using Application.OnKey <key>, <procedure> , I can cause Excel to run <procedure> whenever <key>
How can PHP cause memory leaks, buffer overflows, stack overflows and any other errors
What can be the cause of my Windows CE 6.0 installation to turn to
well I want to debug some script with Firebug, (cause I can't see anything

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.