SfNumericTextBox with Decimal = 8

Hi, I have a form with SfNumericTextBox I want to display something like 0.00000012 

ex 

<SfNumericTextBox @bind-Value="@objsample" TValue="double" ShowSpinButton=false  ValidateDecimalOnType="true" Decimals="8" Format="C8" ></SfNumericTextBox>

but when I type the value and focus out the value turn back to 0, when I focus back the value is 0 

Is there anyway to fix this issue ?

Regards,
Khaled Dehia 

3 Replies 1 reply marked as answer

BC Berly Christopher Syncfusion Team December 31, 2020 07:47 AM UTC

Hi Khaled, 
  
Greetings from Syncfusion support. 
  
We have confirmed the reported issue as a bug at our end and this fix will be included in our patch release scheduled on 13th January 2021. Please track the status of the reported issue from the below feedback. 
  
  
Until then we suggest you to define the TValue type as “decimal” to get rid of the reported issue. Please find the below code snippet. 
  
<SfNumericTextBox @bind-Value="@objsample" TValue="decimal" ShowSpinButton=false ValidateDecimalOnType="true" Decimals="8" Format="C8"></SfNumericTextBox> 
 
public decimal objsample { get; set; } = 0.00000012M; 

  
Regards, 
Berly B.C 


Marked as answer

CM Chris Mortimer July 14, 2021 11:38 AM UTC

This is still doing this on version 19.2.0.47. When I click into the numeric box to goes to 0 rather than 0.00. Also ignores currency. Cheers

 <SfNumericTextBox @bind-Value="@Job.Total" FloatLabelType="FloatLabelType.Always" [email protected]("Total Cost (DUR: £", Job.DefaultUnitRate.ToString("N2"), ")")Currency="GBP" Format="C2" Decimals="2" Min="0" Enabled="!Job.ZeroRated">
            <NumericTextBoxEvents TValue="double" ValueChange="SetLocalState" />        
</SfNumericTextBox>

Attachment: syncfusionnumeric_4849f3d6.zip


BC Berly Christopher Syncfusion Team July 15, 2021 12:58 PM UTC

Hi Chris, 
  
By default, the NumericTextBox component displays the value based on the provided format. If you focus in the component, then it will display the whole number in the input based on the component value property. Due to this, “0.00” will be displayed as 0 when focusing the component. This is the default behavior of the component. Kindly refer the below screenshot. 
  
Type 
On blur action 
On focus action 
For integer value 
 
 
For decimal value 
 
 
 
  
Regards, 
Berly B.C 


Loader.
Up arrow icon