# TtsSpan.DecimalBuilder

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)

# DecimalBuilder

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/android/text/style/TtsSpan.DecimalBuilder "View this page in Java")  

```
open class DecimalBuilder : TtsSpan.SemioticClassBuilder<TtsSpan.DecimalBuilder!>
```

|---|---|---|----------------------------------------------------------------------------------------------------------------------------------------|
| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)                                                               ||||
| ↳ | [android.text.style.TtsSpan.Builder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.Builder)\<C\>                 |||
|   | ↳ | [android.text.style.TtsSpan.SemioticClassBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.SemioticClassBuilder)\<[android.text.style.TtsSpan.DecimalBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.DecimalBuilder#)\> ||
|   |   | ↳ | [android.text.style.TtsSpan.DecimalBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.DecimalBuilder#) |

A builder for TtsSpans of type[TYPE_DECIMAL](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#TYPE_DECIMAL:kotlin.String).

## Summary

|                                                                                                                                                                                                                                                                                                                                                                                                                                                    Public constructors                                                                                                                                                                                                                                                                                                                                                                                                                                                     ||
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [DecimalBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.DecimalBuilder#DecimalBuilder())`()` Creates a builder for a TtsSpan of type[TYPE_DECIMAL](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#TYPE_DECIMAL:kotlin.String).                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| [DecimalBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.DecimalBuilder#DecimalBuilder(kotlin.Double,%20kotlin.Int,%20kotlin.Int))`(`number:` `[Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)`, `minimumFractionDigits:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `maximumFractionDigits:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Creates a TtsSpan of type[TYPE_DECIMAL](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#TYPE_DECIMAL:kotlin.String)and sets the[ARG_INTEGER_PART](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_INTEGER_PART:kotlin.String)and[ARG_FRACTIONAL_PART](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_FRACTIONAL_PART:kotlin.String)arguments. |
| [DecimalBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.DecimalBuilder#DecimalBuilder(kotlin.String,%20kotlin.String))`(`integerPart:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `fractionalPart:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Creates a TtsSpan of type[TYPE_DECIMAL](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#TYPE_DECIMAL:kotlin.String)and sets the[ARG_INTEGER_PART](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_INTEGER_PART:kotlin.String)and[ARG_FRACTIONAL_PART](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_FRACTIONAL_PART:kotlin.String)arguments.                                                                                                             |

|                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          Public methods                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          ||
|--------------------------------------------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| open[TtsSpan.DecimalBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.DecimalBuilder#)! | [setArgumentsFromDouble](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.DecimalBuilder#setArgumentsFromDouble(kotlin.Double,%20kotlin.Int,%20kotlin.Int))`(`number:` `[Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html)`, `minimumFractionDigits:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `maximumFractionDigits:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Convenience method takes a double and a maximum number of fractional digits, it sets the[ARG_INTEGER_PART](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_INTEGER_PART:kotlin.String)and[ARG_FRACTIONAL_PART](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_FRACTIONAL_PART:kotlin.String)arguments. |
| open[TtsSpan.DecimalBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.DecimalBuilder#)! | [setFractionalPart](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.DecimalBuilder#setFractionalPart(kotlin.String))`(`fractionalPart:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Sets the[ARG_FRACTIONAL_PART](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_FRACTIONAL_PART:kotlin.String)argument.                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| open[TtsSpan.DecimalBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.DecimalBuilder#)! | [setIntegerPart](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.DecimalBuilder#setIntegerPart(kotlin.String))`(`integerPart:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Sets the[ARG_INTEGER_PART](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_INTEGER_PART:kotlin.String)argument.                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| open[TtsSpan.DecimalBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.DecimalBuilder#)! | [setIntegerPart](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.DecimalBuilder#setIntegerPart(kotlin.Long))`(`integerPart:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` Convenience method that converts the number to a String and sets it to the value for[ARG_INTEGER_PART](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_INTEGER_PART:kotlin.String).                                                                                                                                                                                                                                                                                                                                                                                                              |

| Inherited functions ||
|---|---|
| From class[Builder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.Builder) |---------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [TtsSpan](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan)! | [build](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.Builder#build())`()` <br /> Returns a TtsSpan built from the parameters set by the setter methods. <br />                                                                                                                                                                                                            | | C                                                                                     | [setIntArgument](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.Builder#setIntArgument(kotlin.String,%20kotlin.Int))`(`arg:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `value:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` <br /> Sets an argument to an int value. <br />                   | | C                                                                                     | [setLongArgument](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.Builder#setLongArgument(kotlin.String,%20kotlin.Long))`(`arg:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `value:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` <br /> Sets an argument to a long value. <br />              | | C                                                                                     | [setStringArgument](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.Builder#setStringArgument(kotlin.String,%20kotlin.String))`(`arg:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `value:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` <br /> Sets an argument to a string value. <br /> | ||
| From class[SemioticClassBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.SemioticClassBuilder) |---|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | C | [setAnimacy](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.SemioticClassBuilder#setAnimacy(kotlin.String))`(`animacy:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` <br /> Sets the animacy information for this instance. <br />                     | | C | [setCase](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.SemioticClassBuilder#setCase(kotlin.String))`(`grammaticalCase:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` <br /> Sets the grammatical case information for this instance. <br />          | | C | [setGender](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.SemioticClassBuilder#setGender(kotlin.String))`(`gender:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` <br /> Sets the gender information for this instance. <br />                         | | C | [setMultiplicity](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.SemioticClassBuilder#setMultiplicity(kotlin.String))`(`multiplicity:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` <br /> Sets the multiplicity information for this instance. <br /> | ||

## Public constructors

### DecimalBuilder

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
DecimalBuilder()
```

Creates a builder for a TtsSpan of type[TYPE_DECIMAL](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#TYPE_DECIMAL:kotlin.String).  

### DecimalBuilder

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
DecimalBuilder(
    number: Double, 
    minimumFractionDigits: Int, 
    maximumFractionDigits: Int)
```

Creates a TtsSpan of type[TYPE_DECIMAL](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#TYPE_DECIMAL:kotlin.String)and sets the[ARG_INTEGER_PART](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_INTEGER_PART:kotlin.String)and[ARG_FRACTIONAL_PART](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_FRACTIONAL_PART:kotlin.String)arguments.  
**See Also**

- [#setArgumentsFromDouble(double, int, int)](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.DecimalBuilder#setArgumentsFromDouble(kotlin.Double,%20kotlin.Int,%20kotlin.Int))  

### DecimalBuilder

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
DecimalBuilder(
    integerPart: String!, 
    fractionalPart: String!)
```

Creates a TtsSpan of type[TYPE_DECIMAL](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#TYPE_DECIMAL:kotlin.String)and sets the[ARG_INTEGER_PART](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_INTEGER_PART:kotlin.String)and[ARG_FRACTIONAL_PART](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_FRACTIONAL_PART:kotlin.String)arguments.

## Public methods

### setArgumentsFromDouble

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun setArgumentsFromDouble(
    number: Double, 
    minimumFractionDigits: Int, 
    maximumFractionDigits: Int
): TtsSpan.DecimalBuilder!
```

Convenience method takes a double and a maximum number of fractional digits, it sets the[ARG_INTEGER_PART](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_INTEGER_PART:kotlin.String)and[ARG_FRACTIONAL_PART](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_FRACTIONAL_PART:kotlin.String)arguments.

|                                                                                                                                            Parameters                                                                                                                                             ||
|-------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `number`                | [Double](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-double/index.html):The number to be synthesized.                                                                                                                                                           |
| `minimumFractionDigits` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The minimum number of fraction digits that are pronounced.                                                                                                                                    |
| `maximumFractionDigits` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html):The maximum number of fraction digits that are pronounced. If maximumFractionDigits \< minimumFractionDigits then minimumFractionDigits will be assumed to be equal to maximumFractionDigits. |

|                                                                Return                                                                ||
|----------------------------------------------------------------------------------------------------------------------|----------------|
| [TtsSpan.DecimalBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.DecimalBuilder#)! | This instance. |

### setFractionalPart

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun setFractionalPart(fractionalPart: String!): TtsSpan.DecimalBuilder!
```

Sets the[ARG_FRACTIONAL_PART](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_FRACTIONAL_PART:kotlin.String)argument.

|                                                            Parameters                                                             ||
|------------------|-----------------------------------------------------------------------------------------------------------------|
| `fractionalPart` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:A non-empty string of digits. |

|                                                                Return                                                                ||
|----------------------------------------------------------------------------------------------------------------------|----------------|
| [TtsSpan.DecimalBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.DecimalBuilder#)! | This instance. |

### setIntegerPart

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun setIntegerPart(integerPart: String!): TtsSpan.DecimalBuilder!
```

Sets the[ARG_INTEGER_PART](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_INTEGER_PART:kotlin.String)argument.

|                                                                           Parameters                                                                           ||
|---------------|-------------------------------------------------------------------------------------------------------------------------------------------------|
| `integerPart` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:A non-empty string of digits with an optional leading + or -. |

|                                                                Return                                                                ||
|----------------------------------------------------------------------------------------------------------------------|----------------|
| [TtsSpan.DecimalBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.DecimalBuilder#)! | This instance. |

### setIntegerPart

Added in[API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)  

```
open fun setIntegerPart(integerPart: Long): TtsSpan.DecimalBuilder!
```

Convenience method that converts the number to a String and sets it to the value for[ARG_INTEGER_PART](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_INTEGER_PART:kotlin.String).

|                                                          Parameters                                                          ||
|---------------|---------------------------------------------------------------------------------------------------------------|
| `integerPart` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html):The integer part of the decimal. |

|                                                                Return                                                                ||
|----------------------------------------------------------------------------------------------------------------------|----------------|
| [TtsSpan.DecimalBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.DecimalBuilder#)! | This instance. |