functions

package
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 13, 2020 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package functions contains list of functions that are commonly used in a project. For instance, formatting of strings or currency values.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToMap

func ConvertToMap(model interface{}, removeID bool, removeEmptyField bool) bson.M

ConvertToMap converts a struct to bson.M This is used for updating the data In this function removes empty fields and id from the struct as per user choice

func CurrencyFormat

func CurrencyFormat(value float64) string

CurrencyFormat returns string representation of value rounded to a floating-point value to up by 2 decimal places

func Round2DecimalPlaces

func Round2DecimalPlaces(value float64) float64

Round2DecimalPlaces rounds to a floating-point value to up by 2 decimal places

func TitleCase

func TitleCase(text string) string

TitleCase makes first letter of words uppercase in a string

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL