<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>30035</bug_id>
          
          <creation_ts>2016-12-19 19:33:11 +0000</creation_ts>
          <short_desc>Input type currency</short_desc>
          <delta_ts>2017-05-29 16:50:03 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>HTML.next</product>
          <component>default</component>
          <version>unspecified</version>
          <rep_platform>PC</rep_platform>
          <op_sys>Windows NT</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>MOVED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Jeff Worthington">jeffrey.l.worthington</reporter>
          <assigned_to name="This bug has no owner yet - up for the taking">dave.null</assigned_to>
          <cc>lwatson</cc>
    
    <cc>mike</cc>
    
    <cc>robin</cc>
          
          <qa_contact name="HTML WG Bugzilla archive list">public-html-bugzilla</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>128334</commentid>
    <comment_count>0</comment_count>
    <who name="Jeff Worthington">jeffrey.l.worthington</who>
    <bug_when>2016-12-19 19:33:11 +0000</bug_when>
    <thetext>Input type of number is good for small numbers, but for currency amounts over 999 the unformatted number being input is hard to read. Imagine having to type in 45,000,000 without the visual feedback of the commas.

We can accomplish this with JavaScript (on an &quot;input&quot; event listener, e.g.):
	   function localizeCurrency() {
			var oldValue = this.value;
			this.rawValue = oldValue ? parseInt(oldValue.replace(/,/g, &apos;&apos;)) : 0;
			if (oldValue) {
				var newValue = parseInt(oldValue.replace(/,/g, &apos;&apos;)).toLocaleString();
				var caretPos = this.selectionStart - (oldValue.length - newValue.length);
				this.value = newValue;
				this.setSelectionRange(caretPos,caretPos);
			}
		}

But it requires an input type of &quot;text&quot; (to allow the commas to appear), and it would be much better to have this in the HTML itself.
&lt;input type=&quot;currency&quot; locale=&quot;usd&quot;&gt;

As I type...what should appear
1           $1.00
10          $10.00
1000        $1,000.00
450000      $450,000.00</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>128615</commentid>
    <comment_count>1</comment_count>
    <who name="Léonie Watson">lwatson</who>
    <bug_when>2017-05-29 16:50:03 +0000</bug_when>
    <thetext>Moved to the HTML repo: 
https://github.com/w3c/html/issues/939</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>