Roshnal
Roshnal

Reputation: 1314

How can I create a decimal-only BasicEditField in BlackBerry?

I'm completely new to BlackBerry development, but I'm experienced in Java ME development. While creating my first to-be-published app, I came across a BasicEditField that has to be constricted to decimal-only (this app is a currency conversion app).

But so far I have not seen a way to do this. I can use BasicEditField.FILTER_REAL_NUMERIC and it will allow only numbers to be typed, but no decimals. The BlackBerry Java Quick Start Guide also doesn't have an example like that.

As this is a fairly common situation, I think there should be some way to achieve this. Any ideas anyone?

Thanks in advance!

Upvotes: 0

Views: 318

Answers (1)

Mister Smith
Mister Smith

Reputation: 28188

This is not a programming problem, but a user-level problem.

BasicEditField.FILTER_REAL_NUMERIC works just fine, and it allows input of positive and negative values with or without decimals. You only have to type the dot key to insert a decimal separator.

Upvotes: 1

Related Questions