MVC5 Classic
Format as Currency

The wijinputnumber widget allows you to formant input as currency. Set the type option to currency to take advantage of this feature. See the InputNumber  > Currency sample of the MVC Control Explorer live demo at http://demo.componentone.com/ASPNET/MVCExplorer/inputnumber/Currency.

  1. Create an C1 ASP.NET MVC 5 Web Application.
  2. In the Solution Explorer, expand the Views | Shared folder and double-click _Layout.cshtml to open the file.
  3. Add the following markup within the <body> tags of the page.
    <input type="text" id="textbox1" value="25.5" />
  4. After the closing </div> tags you added in the previous step, enter the following jQuery script to initialize the wijinputnumber widget and set the type option.
    <script id="scriptInit" type="text/javascript">
                $(document).ready(function () {
                      $("#textbox1").wijinputnumber(
                      {
                          type: 'currency',
                          decimalPlaces: 2,
                          showSpinner: true
                      });
                });
          </script>
    
  5. Press F5 to run the application.

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum |  Documentation Feedback