2015-10-27 1 views
-1

Je voudrais vérifier si une variable est un bigDecimal, existe-t-il une méthode pour cela?java et BigDecimal

mon code:

private KeystrokeTextField myRate; 

// how can i check if myRate.getText() is a bigdecimal? 
BifDecimal test = myRate.getText(); 

Répondre

0

Essayez de créer un BigDecimal (ce qui signifie, appelez le constructeur BigDecimal) en utilisant ce texte. Enveloppez cet appel dans un try/catch.