bond_to_decimal: Converts a vector of fractional bond prices to decimal.

View source: R/bond_to_decimal.R

bond_to_decimalR Documentation

Converts a vector of fractional bond prices to decimal.

Description

This function is designed to handle all flavors of fixed income fractional price quotes and to return decimal equivalents for use in your scripts. Requires a character vector input.

Usage

bond_to_decimal(bond_px)

Arguments

bond_px

A character vector of fractional bond prices, can include decimal prices too

Value

Returns a vector of decimalized bond prices

Examples


# convert fractional bond prices to decimal prices
x <- c("$101-28", "101-2 1/8", "99+")
bond_to_decimal(x)


p-will-b/creditor documentation built on March 28, 2023, 6:46 p.m.