Created fullname function
This commit is contained in:
parent
181a979388
commit
1a129263c2
1 changed files with 13 additions and 0 deletions
13
src/utils/functions/displayFullname.ts
Normal file
13
src/utils/functions/displayFullname.ts
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
export default (firstname: string, middleinitial: string, lastname: string) => {
|
||||||
|
let result
|
||||||
|
if (firstname.length > 0) {
|
||||||
|
if (middleinitial.length > 0) {
|
||||||
|
result = `${firstname} ${middleinitial}. ${lastname}`
|
||||||
|
} else {
|
||||||
|
result = `${firstname} ${lastname}`
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
result = lastname
|
||||||
|
}
|
||||||
|
return result
|
||||||
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue