Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-core
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
intranet-core
Commits
e3cd521b
Commit
e3cd521b
authored
Aug 31, 2004
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- Reorganized /invoice/view
- Added "Create XXX from YYY"
parent
4254b4f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
48 additions
and
0 deletions
+48
-0
intranet-defs-procs.tcl
tcl/intranet-defs-procs.tcl
+48
-0
No files found.
tcl/intranet-defs-procs.tcl
View file @
e3cd521b
...
@@ -1228,3 +1228,51 @@ ad_proc bd_formatDateTz { date fmt gmt localTz} {
...
@@ -1228,3 +1228,51 @@ ad_proc bd_formatDateTz { date fmt gmt localTz} {
return
$r
return
$r
}
}
# ---------------------------------------------------------------
# Auxilary functions
# ---------------------------------------------------------------
ad_proc im_date_format_locale { cur {min_decimals ""} {max_decimals ""} } {
Takes a number in "
Amercian
" format (decimals separated by "
.
") and
returns a string formatted according to the current locale.
} {
ns_log Notice "
im_date_format_locale
(
$cur
,
$min
_decimals,
$max
_decimals
)
"
# Remove thousands separating comas eventually
regsub "
\,
"
$cur
"" cur
# Check if the number has no decimals (for ocurrence of "
.
")
if {!
[
regexp
{
\.
}
$cur
]
} {
# No decimals - set digits to ""
set digits
$cur
set decimals ""
} else {
# Split the digits from the decimals
regexp {(
[
^
\.
]
*)
\.
(.*)}
$cur
match digits decimals
}
if {!
[
string
equal
""
$min
_decimals
]
} {
# Pad decimals with trailing "
0
" until they reach
$num
_decimals
while {
[
string
length
$decimals
]
<
$min
_decimals} {
append decimals "
0
"
}
}
if {!
[
string
equal
""
$max
_decimals
]
} {
# Adjust decimals by cutting off digits if too long:
if {
[
string
length
$decimals
]
>
$max
_decimals} {
set decimals
[
string
range
$decimals
0
[
expr
$max
_decimals-1
]]
}
}
# Format the digits
if {
[
string
equal
""
$digits
]
} {
set digits "
0
"
}
return "
$digits.$decimals
"
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment