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

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
There are certain conditions that can cause stack overflows on an x86 Linux system:
We all know the trouble overflows can cause, and this is why strn* exist
I recall reading somewhere that using references to smart pointers can cause memory corruption.
I am not good at jsp but I wondered what can cause such a
the other day a colleague of mine stated that using static classes can cause
Is this warning anything to worry about? I've read that it can cause erratic
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 I cause a redirect in ASP (pre .NET) to carry the Basic

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.