<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: The Curious Case of the Missing Decimal Point Button</title>
	<atom:link href="http://blog.weareuproar.com/the-curious-case-of-the-missing-decimal-point-button/feed" rel="self" type="application/rss+xml" />
	<link>http://blog.weareuproar.com/the-curious-case-of-the-missing-decimal-point-button</link>
	<description>Crafting convenient mobile apps for your life.</description>
	<lastBuildDate>Sun, 08 Aug 2010 05:14:21 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
	<item>
		<title>By: Tom</title>
		<link>http://blog.weareuproar.com/the-curious-case-of-the-missing-decimal-point-button/comment-page-1#comment-1172</link>
		<dc:creator>Tom</dc:creator>
		<pubDate>Mon, 19 Apr 2010 08:23:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.weareuproar.com/?p=11#comment-1172</guid>
		<description>I have been looking through your example. when i try to run it i get 1 error on this line: @property (nonatomic, retain) NSString *tempStore; 
the error is: Property declaration not in @interface or @implementation  context. 

I&#039;m fairly new to -c and not sure how to fix this error.</description>
		<content:encoded><![CDATA[<p>I have been looking through your example. when i try to run it i get 1 error on this line: @property (nonatomic, retain) NSString *tempStore;<br />
the error is: Property declaration not in @interface or @implementation  context. </p>
<p>I&#8217;m fairly new to -c and not sure how to fix this error.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: wal</title>
		<link>http://blog.weareuproar.com/the-curious-case-of-the-missing-decimal-point-button/comment-page-1#comment-1168</link>
		<dc:creator>wal</dc:creator>
		<pubDate>Sat, 10 Apr 2010 02:17:30 +0000</pubDate>
		<guid isPermaLink="false">http://blog.weareuproar.com/?p=11#comment-1168</guid>
		<description>Jordanc, it&#039;s works perfectly!! Thanks!</description>
		<content:encoded><![CDATA[<p>Jordanc, it&#8217;s works perfectly!! Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jordanc</title>
		<link>http://blog.weareuproar.com/the-curious-case-of-the-missing-decimal-point-button/comment-page-1#comment-1119</link>
		<dc:creator>Jordanc</dc:creator>
		<pubDate>Mon, 01 Feb 2010 19:43:08 +0000</pubDate>
		<guid isPermaLink="false">http://blog.weareuproar.com/?p=11#comment-1119</guid>
		<description>This is how I did it. I&#039;m not sure it&#039;s the best way, but it works:

@property (nonatomic, retain) NSString *tempStore;

---------

- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string
	{
		if ([string length] &gt; 0)  { //NOT A BACK SPACE Add it 
			
		self.tempStore  = [NSString stringWithFormat:@&quot;%@%@&quot;, self.tempStore, string];
		} else {
			//Back Space do manual backspace
			if ([self.tempStore length] &gt; 1) {
			self.tempStore = [self.tempStore substringWithRange:NSMakeRange(0, [self.tempStore length]-1)];
			} else {self.tempStore = @&quot;0&quot;;}
				
		}
		// Convert to decimal place
		float tempDouble = [self.tempStore floatValue];
		tempDouble = tempDouble / 100;
		textField.text = [NSString stringWithFormat:@&quot;$%.2f&quot;, tempDouble];		
		return NO;
	}</description>
		<content:encoded><![CDATA[<p>This is how I did it. I&#8217;m not sure it&#8217;s the best way, but it works:</p>
<p>@property (nonatomic, retain) NSString *tempStore;</p>
<p>&#8212;&#8212;&#8212;</p>
<p>- (BOOL)textField:(UITextField *)textField shouldChangeCharactersInRange:(NSRange)range replacementString:(NSString *)string<br />
	{<br />
		if ([string length] &gt; 0)  { //NOT A BACK SPACE Add it </p>
<p>		self.tempStore  = [NSString stringWithFormat:@"%@%@", self.tempStore, string];<br />
		} else {<br />
			//Back Space do manual backspace<br />
			if ([self.tempStore length] &gt; 1) {<br />
			self.tempStore = [self.tempStore substringWithRange:NSMakeRange(0, [self.tempStore length]-1)];<br />
			} else {self.tempStore = @&#8221;0&#8243;;}</p>
<p>		}<br />
		// Convert to decimal place<br />
		float tempDouble = [self.tempStore floatValue];<br />
		tempDouble = tempDouble / 100;<br />
		textField.text = [NSString stringWithFormat:@"$%.2f", tempDouble];<br />
		return NO;<br />
	}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jeff</title>
		<link>http://blog.weareuproar.com/the-curious-case-of-the-missing-decimal-point-button/comment-page-1#comment-1105</link>
		<dc:creator>Jeff</dc:creator>
		<pubDate>Tue, 22 Dec 2009 06:25:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.weareuproar.com/?p=11#comment-1105</guid>
		<description>Thanks for the great idea on currency input.  I second Erik&#039;s request for an example of using shouldChangeCharactersInRange.  I don&#039;t quite get how you use that delegate method and the currency formatter together.</description>
		<content:encoded><![CDATA[<p>Thanks for the great idea on currency input.  I second Erik&#8217;s request for an example of using shouldChangeCharactersInRange.  I don&#8217;t quite get how you use that delegate method and the currency formatter together.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Erik</title>
		<link>http://blog.weareuproar.com/the-curious-case-of-the-missing-decimal-point-button/comment-page-1#comment-1017</link>
		<dc:creator>Erik</dc:creator>
		<pubDate>Thu, 05 Nov 2009 08:40:27 +0000</pubDate>
		<guid isPermaLink="false">http://blog.weareuproar.com/?p=11#comment-1017</guid>
		<description>I would love if someone could post a shouldChangeCharactersInRange solution for this with localized formatting!</description>
		<content:encoded><![CDATA[<p>I would love if someone could post a shouldChangeCharactersInRange solution for this with localized formatting!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kevin</title>
		<link>http://blog.weareuproar.com/the-curious-case-of-the-missing-decimal-point-button/comment-page-1#comment-942</link>
		<dc:creator>kevin</dc:creator>
		<pubDate>Wed, 16 Sep 2009 01:13:37 +0000</pubDate>
		<guid isPermaLink="false">http://blog.weareuproar.com/?p=11#comment-942</guid>
		<description>@Bruce LeSourd

Yep, this is only viable for currency and other values where the decimal can be inferred.  For instance, this would also work for measurements with fixed precisions like medical dosages (never more than 2 or 4 decimal places).

And yes, you are right in that it does require 2 extra taps for currency values ending in .00.  However, this only occurs 1% of the time.

So, as compared to a decimal button design, this design...

1% of the time requires 2 extra taps (whole amounts; eg $123.00)

9% of the time requires the same number of taps (amounts ending in multiples of 10 cents; eg, $123.10)

90% of the time saves 1 tap (all other amounts; eg $123.45)

My guess as to why Apple doesn&#039;t provide a stock keypad with a decimal point is that it is not that common of a use-case.  If you use the design outlined in this post you will hit most of the use cases where people are asking for a decimal button today.  In other words, the number of apps today that legitimately require just 0-9, decimal, and backspace buttons are very few and not worth introducing another NumericKeypad option to include the decimal button.

As for Apple offering a custom keypad API, I don&#039;t see the need.  Additionally, I think creating a first-class, generic UI API to construct a keypad would be difficult.  With the 1.2 update to Gratuitous, I rolled my own keypad (details in a future blog post) and it was surprisingly simple.

Thanks for the feedback and your thoughts on this post, I really appreciate it!</description>
		<content:encoded><![CDATA[<p>@Bruce LeSourd</p>
<p>Yep, this is only viable for currency and other values where the decimal can be inferred.  For instance, this would also work for measurements with fixed precisions like medical dosages (never more than 2 or 4 decimal places).</p>
<p>And yes, you are right in that it does require 2 extra taps for currency values ending in .00.  However, this only occurs 1% of the time.</p>
<p>So, as compared to a decimal button design, this design&#8230;</p>
<p>1% of the time requires 2 extra taps (whole amounts; eg $123.00)</p>
<p>9% of the time requires the same number of taps (amounts ending in multiples of 10 cents; eg, $123.10)</p>
<p>90% of the time saves 1 tap (all other amounts; eg $123.45)</p>
<p>My guess as to why Apple doesn&#8217;t provide a stock keypad with a decimal point is that it is not that common of a use-case.  If you use the design outlined in this post you will hit most of the use cases where people are asking for a decimal button today.  In other words, the number of apps today that legitimately require just 0-9, decimal, and backspace buttons are very few and not worth introducing another NumericKeypad option to include the decimal button.</p>
<p>As for Apple offering a custom keypad API, I don&#8217;t see the need.  Additionally, I think creating a first-class, generic UI API to construct a keypad would be difficult.  With the 1.2 update to Gratuitous, I rolled my own keypad (details in a future blog post) and it was surprisingly simple.</p>
<p>Thanks for the feedback and your thoughts on this post, I really appreciate it!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bruce LeSourd</title>
		<link>http://blog.weareuproar.com/the-curious-case-of-the-missing-decimal-point-button/comment-page-1#comment-938</link>
		<dc:creator>Bruce LeSourd</dc:creator>
		<pubDate>Tue, 15 Sep 2009 22:12:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.weareuproar.com/?p=11#comment-938</guid>
		<description>Nice idea.

Of course, to enter $123.00, it requires two extra taps, like an ATM machine.  And as John Smith noted, this only works for the familiar currency situation.

There&#039;s no excuse for Apple not to have a decimal point option on a numeric keypad!  Or a public API facility for building custom keypads.</description>
		<content:encoded><![CDATA[<p>Nice idea.</p>
<p>Of course, to enter $123.00, it requires two extra taps, like an ATM machine.  And as John Smith noted, this only works for the familiar currency situation.</p>
<p>There&#8217;s no excuse for Apple not to have a decimal point option on a numeric keypad!  Or a public API facility for building custom keypads.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: John Smith</title>
		<link>http://blog.weareuproar.com/the-curious-case-of-the-missing-decimal-point-button/comment-page-1#comment-204</link>
		<dc:creator>John Smith</dc:creator>
		<pubDate>Sun, 23 Aug 2009 18:20:14 +0000</pubDate>
		<guid isPermaLink="false">http://blog.weareuproar.com/?p=11#comment-204</guid>
		<description>Hi

I saw you comment on my question about the keyboard on stackoverflow. Unfortunately in my case I am not dealing with fixed decimal points so I really do need a decimal point.

Your solution here would only work in certain situations.</description>
		<content:encoded><![CDATA[<p>Hi</p>
<p>I saw you comment on my question about the keyboard on stackoverflow. Unfortunately in my case I am not dealing with fixed decimal points so I really do need a decimal point.</p>
<p>Your solution here would only work in certain situations.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kevin</title>
		<link>http://blog.weareuproar.com/the-curious-case-of-the-missing-decimal-point-button/comment-page-1#comment-11</link>
		<dc:creator>kevin</dc:creator>
		<pubDate>Fri, 15 May 2009 16:07:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.weareuproar.com/?p=11#comment-11</guid>
		<description>Glad to hear you got this working in your own code, Mike.  It sounds like you handled it the same way we are.  We&#039;ve got a singleton utility class that has a single instance of a formatter that is used to do the conversions.</description>
		<content:encoded><![CDATA[<p>Glad to hear you got this working in your own code, Mike.  It sounds like you handled it the same way we are.  We&#8217;ve got a singleton utility class that has a single instance of a formatter that is used to do the conversions.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mike</title>
		<link>http://blog.weareuproar.com/the-curious-case-of-the-missing-decimal-point-button/comment-page-1#comment-9</link>
		<dc:creator>Mike</dc:creator>
		<pubDate>Thu, 14 May 2009 19:25:15 +0000</pubDate>
		<guid isPermaLink="false">http://blog.weareuproar.com/?p=11#comment-9</guid>
		<description>I seem to have sorted this out with about 6 lines of code based around utilizing NSDecimalNumber&#039;s decimalNumberByMultiplyingByPowerOf10 within UITextField&#039;s shouldChangeCharactersInRange delegate method.

Still be interested in seeing how you handled it as I&#039;m doing conversions from NSString to NSDecimalNumber with and back NSNumberFormatters involved upon ever single &quot;key&quot; press from the user. but, it&#039;s working!</description>
		<content:encoded><![CDATA[<p>I seem to have sorted this out with about 6 lines of code based around utilizing NSDecimalNumber&#8217;s decimalNumberByMultiplyingByPowerOf10 within UITextField&#8217;s shouldChangeCharactersInRange delegate method.</p>
<p>Still be interested in seeing how you handled it as I&#8217;m doing conversions from NSString to NSDecimalNumber with and back NSNumberFormatters involved upon ever single &#8220;key&#8221; press from the user. but, it&#8217;s working!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

