Skip to main content

FloatType

A float value paired with an OCR confidence score.

Package: com.microblink.core

Declaration

class FloatType : Parcelable

Constructors:

FloatType(value: Float) // confidence = 100
FloatType(value: Float, confidence: Float)

Quick Reference​

Properties​

PropertyDescription
value()The raw float value
confidence()OCR or parsing confidence score
decimal()Value rounded to 2 decimal places
toBigDecimal()Non-null BigDecimal representation

Properties​

value()​

fun value(): Float

The raw float value.


confidence()​

fun confidence(): Float

OCR or parsing confidence score. 100 when created with the one-argument constructor.


decimal()​

fun decimal(): Double
fun decimal(scale: Int): Double
fun decimal(scale: Int, mode: RoundingMode): Double

Returns the value rounded to 2 decimal places (default), a given scale, or with an explicit RoundingMode. Suitable for currency display.


toBigDecimal()​

fun toBigDecimal(): BigDecimal

Non-null BigDecimal representation of the value.