# TtsSpan.MoneyBuilder

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

# MoneyBuilder

*** ** * ** ***

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

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

|---|---|---|------------------------------------------------------------------------------------------------------------------------------------|
| [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.MoneyBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MoneyBuilder#)\> ||
|   |   | ↳ | [android.text.style.TtsSpan.MoneyBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MoneyBuilder#) |

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

## Summary

|                                                                                                                           Public constructors                                                                                                                           ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [MoneyBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MoneyBuilder#MoneyBuilder())`()` Creates a TtsSpan of type[TYPE_MONEY](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#TYPE_MONEY:kotlin.String). |

|                                                                                                                                                                                                                                                                                Public methods                                                                                                                                                                                                                                                                                ||
|----------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| open[TtsSpan.MoneyBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MoneyBuilder#)! | [setCurrency](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MoneyBuilder#setCurrency(kotlin.String))`(`currency:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Sets the[ARG_CURRENCY](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_CURRENCY:kotlin.String)argument.                                                                              |
| open[TtsSpan.MoneyBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MoneyBuilder#)! | [setFractionalPart](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MoneyBuilder#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.MoneyBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MoneyBuilder#)! | [setIntegerPart](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MoneyBuilder#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.MoneyBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MoneyBuilder#)! | [setIntegerPart](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MoneyBuilder#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 set it to the value for[ARG_INTEGER_PART](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_INTEGER_PART:kotlin.String). |
| open[TtsSpan.MoneyBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MoneyBuilder#)! | [setQuantity](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MoneyBuilder#setQuantity(kotlin.String))`(`quantity:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Sets the[ARG_QUANTITY](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan#ARG_QUANTITY:kotlin.String)argument.                                                                              |

| 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

### MoneyBuilder

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

```
MoneyBuilder()
```

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

## Public methods

### setCurrency

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

```
open fun setCurrency(currency: String!): TtsSpan.MoneyBuilder!
```

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

|                                                                  Parameters                                                                  ||
|------------|----------------------------------------------------------------------------------------------------------------------------------|
| `currency` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!:Should be a ISO4217 currency code, e.g. "USD". |

|                                                              Return                                                              ||
|------------------------------------------------------------------------------------------------------------------|----------------|
| [TtsSpan.MoneyBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MoneyBuilder#)! | 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.MoneyBuilder!
```

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)!:Can be a string of digits of any size. |

|                                                              Return                                                              ||
|------------------------------------------------------------------------------------------------------------------|----------------|
| [TtsSpan.MoneyBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MoneyBuilder#)! | 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.MoneyBuilder!
```

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.MoneyBuilder](https://developer.android.com/reference/kotlin/android/text/style/TtsSpan.MoneyBuilder#)! | 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.MoneyBuilder!
```

Convenience method that converts the number to a String and set 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 amount. |

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

### setQuantity

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

```
open fun setQuantity(quantity: String!): TtsSpan.MoneyBuilder!
```

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

|                                           Parameters                                           ||
|------------|------------------------------------------------------------------------------------|
| `quantity` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: |

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