Decimal.Num.Count: Number of Decimal Places

View source: R/other_functions.R

Decimal.Num.CountR Documentation

Number of Decimal Places

Description

This function gives the number of decimal places of a number written as character string or numeric object.

Usage

Decimal.Num.Count(x)

Arguments

x

Number in character or in numeric class.

Value

An integer.

Note

Note that when object given is a character then trailing zeros are not dropped and all the decimal places are returned. For example, Decimal.Num.Count("0.10") gives 2 decimal places instead of 2.

Author(s)

Omer Kara

Examples

Decimal.Num.Count(0.1)
Decimal.Num.Count("0.1")
Decimal.Num.Count("0.10")
Decimal.Num.Count(0.10)

Decimal.Num.Count(0.12345)
Decimal.Num.Count("0.12345")


omerkara/okara documentation built on Nov. 21, 2023, 7:56 p.m.