# Tick.fromPrice

Converts a price string to a tick.

[Stablecoin DEX Pricing](https://docs.tempo.xyz/protocol/exchange/spec#key-concepts)

## Imports

:::code-group
```ts [Named]
import { Tick } from 'ox/tempo'
```

```ts [Entrypoint]
import * as Tick from 'ox/tempo/Tick'
```
:::

## Examples

```ts
import { Tick } from 'ox/tempo'

// Price of 1.0 = tick 0
const tick1 = Tick.fromPrice('1.0') // 0
const tick2 = Tick.fromPrice('1.00000') // 0

// Price of 1.001 = tick 100
const tick3 = Tick.fromPrice('1.001') // 100

// Price of 0.999 = tick -100
const tick4 = Tick.fromPrice('0.999') // -100
```

## Definition

```ts
function fromPrice(
  price: fromPrice.Price,
): fromPrice.ReturnType
```

**Source:** [src/tempo/Tick.ts](https://github.com/wevm/ox/blob/main/src/tempo/Tick.ts#L187)

## Parameters

### price

* **Type:** `fromPrice.Price`

The price as a string (e.g., "1.001", "0.999").

## Return Type

The tick value.

`fromPrice.ReturnType`
