Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Input number does not respect step

$
0
0

the input is always showing 4 decimal places. Is there a way to limit it to 2?

I've tried doing a math.round at the database, I've tried using formatting of f2, it does not seem that anything I try will get the thing to limit to 2 decimal places.

@page "/"<h1>Counter</h1><p>Current count: @currentCount</p><button class="btn btn-primary" @onclick="IncrementCount">Click me</button><input type="number"       step="0.01"       class="rounded no-spinner p-2 text-right w-full"       @bind="currentCount" />@functions {    decimal currentCount = 0.0001m;    void IncrementCount()    {            currentCount = currentCount + 1.2m;    }}

blazorfiddle


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>