Typescript Float type with examples
- Admin
- Dec 6, 2023
- Typescript
This tutorials explains about how to declare and assign an float values in Typescript
Typescript language provides below types that stores numeric values.
number
type to store primitive values
Number
type to store objects
Numeric numbers contains values such as integers such as -2,0,-1 float numbers such as 1.68,7.45
Typescript float type
float is a numeric value with decimals. It declared using normal variable sytnax and assign the floating values.
let price: number= 1.23
let totalCost: number;
totalCost= 2 *number;