Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue of InputNumber component #3789

Open
liangjinnian opened this issue Apr 9, 2024 · 2 comments
Open

Issue of InputNumber component #3789

liangjinnian opened this issue Apr 9, 2024 · 2 comments

Comments

@liangjinnian
Copy link

liangjinnian commented Apr 9, 2024

image

If the initial value of MyValue is 0, then enter -0 in the InputNumber component and submit the form. The displayed value on the page is 0.
If the initial value of MyValue is 1, then enter -0 in the InputNumber component and submit the form. The result displayed on the page is -0. What if you want to input -0 and get 0 regardless of the initial value of MyValue?

@ElderJames
Copy link
Member

Thanks for contacting us @liangjinnian, this is because -0 and 0 in both double and float is two value. So you can handle the format by your self.

@(MyValue==0.0d?0.0d:MyValue );

@liangjinnian
Copy link
Author

Hello @ElderJames , I don't quite understand. I used it this way in the project, but it didn't achieve the desired effect
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants